Git Product home page Git Product logo

synacor-challenge's Introduction

Synacor-Challenge

My solution to the synacor challenge

Google the synacor challenge to find the website.
arch-spec gives you all the instructions you need to build a vm that can run.... challenge.bin - contains all the data and code that forms the second part of the challenge.

The first part of the challenge is to use the arch-spec to build a vm in any language you like (mine is python3) that can run the binary. You collect some codes along the way that you can input into the synacor challenge website to track your progress.

The challenge.bin file contains a lot of self-testing code that validates whether your vm is conformant to the arch-spec or not. If it is, then you get to the second part of the challenge - an old fashioned text adventure game.

As well as the usual text adventure game stuff (exploring; collecting and using certain objects; avoiding dying, etc.), you will also have to solve some puzzles. Two can be solved either by writing a short program, or even pen and paper. One of the problems seemed to require some disassembly and analysis of a portion of code, and then some minor changes to the code run in the vm to make the solution work. There are probably multiple ways to crack that one.

Along the way, my vm (vm.py) grew as I added a means of regurgitating game text instructions (instr.txt) into the vm (to save typing the same stuff time and again). I also added special codes into the insgtruction file and the function that processes it to do various things like speed up, slow down the vm, output the current vm program code (it modifies itself in-game I think), and some trace and disassembly functions.

Rather than a massive 'case' type statement or if, elif, etc for each instruction in the VM, I have used a dictionary of opcodes that point to the respective functions, so the despatcher to call the right function is really neat and simple. Most of the vm instructions are handled in one-line functions in python.

Rather enjoyed this challenge - the grin on my face when my VM passed the self tests in challenge.bin and booted up an adventure game was worth the effort.

synacor-challenge's People

Contributors

p3rki3 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.