Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: The Choice – An online programming puzzle RPG (amos.me)
95 points by nddrylliog on May 30, 2013 | hide | past | favorite | 111 comments



Is there an API reference? I don't remember how to ask a guard for a key, and apparently it's not guard.askKey.

edit: Ahh, got it. The @key was already given to me (was this specified somewhere?), so the guard didn't support askKey. I wonder if there's a more appropriate response than not having the method, but I'm not sure what it would be.


Yes, this got me too. I expected that it would be required to ask the guard for another key, and when that was supported I figured I must've misremembered the command. Then I tried passing in my previous key variable in case it was still stored there. Took a while to try unlocking without specifying a key.


Had the same problem: I thought I had to add on top of the previous step. But asking for the key and unlocking the door was not necessary at that step.


'guard' is just a placeholder. Try typing

    key = @xzoor.askKey(@door)


Yeah, it was my placeholder. I was being told that @xzoor didn't have an askKey method, because it looks like he only does on the one level where you're told to ask him for it.


Very cool. What are you using for the voice synthesizer?

Also, I'm stuck on a bug: When I hit command-enter after typing "open @left", it spawns a new window with http://thechoice.amos.me/[object%20Object]. (Chrome 27, Mac 10.8)


See, that's a very interesting "bug" that was reported to me before.

Here's a little behind the scenes: your answers are actually CoffeeScript that get compiled on the client (along with some support code for each question) and eval'ed.

Since window.open is defined, that's what's happening here.

The commands you're looking for, for that question, are more along the lines of 'enter'.

EDIT: for voice synthesis: speaker.js - an Emscripten-compiled version of espeak. It sounds crappy, which is just a perfect casting for this voice.


Do you have a link for speaker.js? I found "Speak-js" (https://github.com/mattytemple/speak-js) which is also emscripten-compiled from a C++ speech synthesizer. Same thing? Also, great game thanks for sharing with us; I very much enjoyed it.


This is like the programming version of the Portal games.


<3


Hi! The Choice dev here - this is Episode 1, there'll be more to come. Tell me how you like it, how you felt doing it, what was hard, what was easy, what was fun, what was annoying, everything! Episode 2 may come out in June if I find enough people like it ;)


I accidentally hit Alt-Bkspc instead of Ctrl-Enter and lost all my state. Gah. Had I been a little farther along I probably wouldn't have been willing to start over to get back to where I was.

It would be nice if the game put itself in the history, so that Back would only take you to (say) the previous challenge. (That would also really help when you're trying to remember the syntax of a command.)


Little know fact: there are 'save codes' - you can load the codes using hashtags, e.g. http://thechoice.amos.me/#firstdoor will bring you right to the programming part.

Didn't take the time to update the hash to reflect that though - some people would've noticed the URL has changed, others wouldn't have, and I would have needed to find an interface artifact to make sure most people get it.

TL;DR design is fucking hard but if you dig most dev-friendly features are in.

As for backspace doing back, blame your favorite browser maker. And change the defaults. And report an issue. That behavior (previous on back) was always idiotic, imho.


Can you list some of the save codes for us? I've lost state more than a few times (old habit of hitting command-r to run code doesn't work well in browser-based development).


firstdoor, twodoors, secret, randomsecret, conditionals, lying, ship


Maybe store the game state in cookies so it can be resumed implicitly, but have the game restarted explicitly, by clearing them?


Oops, I just lost my progress by pressing Backspace… you might want to save the progress in local or session storage.

I like the humor of the machine but I arrived at the tests about conditional but couldn't remember the command to ask for a key. A way to get back to what I've seen could be nice.


Nice idea, the start was a little bumpy though because it wasn't really clear what I was supposed to do (answer with the word answer xxx, answer 'xxx' or just xxx). For a non-programmer this would be a bit of a leap perhaps. The first puzzles didn't really feel at all connected to the rest of the game to me (questions about ineffable things).

It'd be nice if the program initially responded to more english words, to make the initial interaction more fun.

At one point I got stuck because '' was expected around a value but this wasn't obvious from the previous steps.

The use of @ before predefined variables doesn't really seem necessary.

Allowing users to add variables is a nice touch

Chrome sometimes took cmd-return to mean open a new browser tab, not sure why.


I like it. Perhaps for further chapters, an escaped human could be be controlling a machine, that has had it's memory wiped, remotely in order to infiltrate a machine base.


Marry me! I mean, join the team!

But seriously, Chapter 2 is all about deconstructing the game.

It's easy at first.. but then it gets harder. Erasing your traces... reverse-engineering protocols.. introducing you to netsec against your will.

Consider Chapter 1 an appetizer.


What are the answers? I can't even get past test one.


look in the console log if you're stuck :)


Hey, have the source while you're at it - http://github.com/nddrylliog/thechoice

You only get to experience it once though - once you spoil it for yourself, it's spoiled. Choose carefully.


Thanks for the source - I completed the game though didn't realize at first that the vehicle was auto-unloading - at first I thought I was just losing numans somewhere in space :) I now see I was a bad test subject and didn't read the description properly.


I try not to blame players - although it might not show I've already done quite a bit of user testing (esp. with non-coders to make sure it's relatively easy to follow.

In this case, the 'numans' part was the last one I added, in a hurry, and only had 2-3 iterations on this part of the dialog/instructions.

Which goes to show: testing matters, iterations makes things better.

Thanks for the feedback!


with regards to numan parts, its not creative. just plain code repeat. Get a condition going. like numan and borg where borg will eat numan if numan is less than borg or something


It's merely a setup for a more creative problem which I didn't have time to include. Here's the actual problem: numans have different weights, which incurs a speed penalty on the transport vehicle - numans[i] has a penalty of 2^i - the goal is to write code to carry them all in the minimum possible time (15 units).

For a coder, the numan part is easy and boring and repetitive - then again, it fits with the universe. For a non-coder, it's their first or second encounter with a piece of code that's more than 4 lines long, with a detailed log so that they can go back and forth to see where they went wrong. They have several rules that they need to pay attention to (capacity, 1 passager minimum required, auto-unload, be very precise with station names) - which, again, seems trivial to you as a coder, but isn't to everyone.

There's already so many instructions for this problem, I wanted to add the time penalty part as a second problem, e.g. "your solution would work, but we can't afford to spend N time units on this transfer - (insert additional instructions here)". I'm sure you understand the need for a consistent difficulty curve.


I've forked the repo and I'll help what I could. By the way, I never played much text games. But the existence of the overlord voice and funny lines is something that makes me keeps going.


The source is really fun to read through. I definitely responded 'cataracts' to 'The more you have it, the less you see. What is it?' question and it was cool to see it in your wrongdir category.


I got stuck on the crime question, and cheated. They're pretty difficult riddles! It wasn't immediately clear a hint would appear (after my first 6 answers).

Now I'm stuck in the door. Its interesting and somewhat fun, but I'm not sure I have all day to fail fail fail fail fail. Perhaps you could share your dropoff metrics once you have more data.


Yup, would've added more analytics if I had the time - consider this a first foray into the world of "let's teach people stuff without them being even aware of it because they're caught in the story".

Hopefully! This is an experiment. Expect next episodes to be in increasing order of difficulty... Episode 2 is about deconstructing the game...

Btw, hints drop if you fail more than 5 times at a question. Just putting that out there.


I'll be honest, I don't understand the logic I need to get through the truth-teller/liar test since it isn't quite clear what I'm allowed to do. If you just want me to do a ton of embedded if/else statements, meh, I've lost interest.

If the goal it to teach programming, increase an interest in programing, or expose a language that others might not be exposed to, the worst way to do it it to make your target audience feel stupid. The initial questions to show the answer command aren't very easy - frankly they are seriously flawed riddles. Second, showing variables isn't described well enough to intrinsically know what to do unless you've already been exposed to programming.

I guess it all depends on the target audience, but it's not all that clear who that is.


If you have a ton of embedded if/else statements you're doing it wrong. Only one if/else is required.

Thanks for giving me a course about game design and asking questions obviously not answered in Chapter 1. Where can I send you money? <3.


Thanks for giving me a course about game design and asking questions obviously not answered in Chapter 1. Where can I send you money? <3.

Did you not post this expecting constructive feedback? Snark aside, chapter 1 of what? You haven't made it clear what this really is. Is this python? Do you want to use a game to teach the language or is this just a game and the language is irrelevant?

On the question I was having trouble with I was over thinking the isTrue method. It just wasn't all that clear to me until I did some pseudo debugging with it.


The language is irrelevant. It's coffeescript, but the whole thing is 'beatable' with an understanding of logic by following its instructions.

If you've never programmed before at all, some parts would indeed be tricky, including the part you mentioned. Still, if you understand how to solve the logic puzzle, you could do it using a temporary variable as previously demonstrated, rather than the more natural (to programmers) nested calls.


That's exactly the point of the game :) Thanks for explaining it.


Nested if statements? I'd be interested to see how that looks.

You only need one if statement, and you only have to involve a single guard.


Spoiler: Curious what other people did here. My approach on each step was to simply "test" some code to see what happened before attempting to solve the puzzle. I tested `@xzoor.isTrue(0)` just to see... not very creative but it works for finding the lying guard.

I used the same approach to test the last puzzle (#ship) and did: `for n in @numans n.board(@vehicle) @vehicle.fly(#3127)` which ends the game (even though this doesn't satisfy the puzzle).


I liked this. It reminded of poking around in a dos prompt trying to figure out how to play sierra online games. It stuff like this that got me into computers.

I got stuck at the Lying part. I was able to figure out both of them were lying to me. But still failed to complete the task. I wonder though how "difficult" these challenges are? I still consider myself a beginning programmer even though I can build web sites, and small basic python and javascript programs. Someone once told me I suffer from imposter syndrome. I never though so until using your application. I couldn't help but think "I don't belong here". With that said, I still found it fun, challenging, and frustrating at the same time.


Pretty good execution, I was entertained. I didn't mind the puzzle difficulty, though the answers felt arbitrary. It was confusing going back from @left and @right to @door, which seemed puzzling for sure but guessing's no fun.

If the language were clearly built up on the screen (syntax, literals) it'd be easier to work with the EEM. Showing the bound functions would help, too, but would demystify the puzzle aspect. Sexps are more natural to me than this super sugary syntax that leaves you guessing, more or less. Guessing language syntax is no more fun than guessing random numbers. :( I would definitely play an Episode 2.


Thanks for the feedback!

Many people have complained about @door vs @left/@right - the reason for that obviously was poor decision-making during crunch time.

Making the game accessible to non-coders (it is - they just take more time - but are usually better at riddles) was hard, and caused some hard decisions to be made.

I'll try to make Episode 2 more polished. All this feedback is very valuable, though.

As someone once said: "If you're not ashamed of it, you haven't released it soon enough".


I liked it. The first questions was harder than the actual programming quizes, which maybe wasn't the goal.

I can't wait for part two!

Edit; I found a few bugs, commands like "print" and "open" does what window.print() and window.open() does. Is this intentional?



I'd love a way to turn off the voice. As neat as it is, there's a noticeable pause on each new instruction, relative to the length of the instruction, where I assume it's busy synthesizing the audio it's about to play.



I could use a checkbox to shut off the voice. It gets a little annoying after a while.

Very nice. Somewhat fun and interesting. Xzoor isn't a very good guard if he's telling you specifics about your prison!


See: https://news.ycombinator.com/item?id=5796039

You're not in a prison. Much in the story is left to your imagination, but I can tell you this: you are very much a "free" agent in this universe. However, your value is constantly under thorough investigation to see if you shall remain a human, or be deemed a numan.

Hopefully Episode 2 will bring more answer as to what exactly this universe is, how it works, and how you can actually fight back.


At the very end:

> Tell me what you think about it by sending me a tweet.

ugh, really?

Other than that, quite cool, though the first question was needlessly oblique and I stopped playing right there the first go around.


Yup, really - at this point it's not EEM talking anymore, it's me, the dev, a human being, who primarily engages with other human beings online for gamedev feedback via Twitter. It's not an HN stunt :)


I loved that question, it helps you to get into the mood of the game.


Exactly. And if you've been paying attention since the start of the game, instead of treating it like a codeacademy or similar programming challenge type, you've already picked up on a few clues that.. the government (and its minions, including EEM) don't really hold you in high esteem.


What's the answer? I'm stuck.


If you're referring to the "what is more useless" question, the answer is "nothing"


Thanks. I couldn't figure it out for over 5 hours.


'Null' also works


Very entertaining! Is it aiming to be an intro tool for programming? I think it would work well as one.

Maybe literals (specifically strings) could be introduced a little more somehow.

Maybe @xzoor should have a more obvious human name like @jeff (since it's rather similar to @door)

At one point I forgot a method name, and couldn't scroll back to find it, I don't think it should be a test of memory (unless that's exactly what it is and in which case I deserve all the abuse my robot overloads can give)


The @xzoor and @door similarity is a fair point - although @xzoor has a kind of emotional sensibility to me, I don't know if could change it. @portal would work for the door, though ;)

Non-human names are kinda voluntary. It's a hostile universe, ruled by machines. You're the underdog. You're survining through your coding abilites only. The fight back only begins with Episode 2 (covering subjects like 'cryptography' / 'security').

About forgetting method names etc: Episode 2 (and updated Episode 1) should definitely have a backlog - your previous responses. That's gotta be the top requested feature.


Speaking of @door, the @ signs seem gratuitously syntaxy. I guess it helps with the machine-world ambience, but much more of that kind of thing in the language would make it easy to stop playing.

(I liked the game so far.)


As I was completing the fly the Numans problem I felt kind of dirty because I thought I should really be using a for loop of some kind.


Hey, if you know CoffeeScript and feel confident, everything is fair game.

The game is supposed to be accessible to non-coders as well, hence all the hand-holding.

If you feel frustrated because the first chapter is too simple, you're gonna like the next ones...


Actually you can use a while loop, i couldn't figure out the syntax for a "for" loop but while works fine.



ha never made it past the first test... looks neat though.


yep. i don't think i have the right background to answer this. is this based on a book or something from nerd culture?


Yeah I think that might be it to... once again though seemed like a cool idea


Nope, but I'll take this as a compliment.

There are a few references here and there (jabberwocky being perhaps the most obvious one), but otherwise, mostly original.


You need to take the mindset of someone who hates humans. Just channel Kahn, it will be easy.


C'mon, don't give up! There are hints.. :)


I'm stuck on the very first problem.

    EEM: Here is your first assignment.
    It is more useless than you. What is it?
I have no idea what it is and the hints aren't helping. Isn't anyone else stuck there too? Or is it personalized/randomized for different people?


Just have to be creative/logical at the same time. Simple! :)


answer 'nothing'


On the step with the doors and the lier guard, there is a trick to know which guard is lying by asking one question only. This is due to the fact that you use coffeescript. Maybe you should whitelist the parameters allowed for the questions, to avoid "cheating".


See cheating is part of the game - in Chapter 1 it's a bit weak really, but in Chapter 2 it's part of the game.

Surely humans do fight back at one point. Don't they?


Ahah fair enough, anyway I think this can be a good and funny introduction to programmation which makes more sense than platforms like codeacademy, etc... Nice job :)


Nice, that will help me to forget the guilt of asking the guard a "proven" truth ;)


I really like it a lot. Somehow I got unfocused from the text box and tried to backspace to clear out my answer, which took me back in my browser and lost my progress :( maybe some client side storing of progress could be helpful. I was having so much fun!


Took a few tries but I managed to finish it. I'd suggest removing the riddle parts since they can be pretty frustrating and aren't directly programming related. Or maybe give increasingly helpful hints and eventually the full answer.


I loved the riddles -- they really set the tone -- but yeah, that can keep people out who'd dig the rest.


Well, that's true. I've tried to make the game appeal to both non-coders and coders: non-coders seem faster at solving the riddles but on the other hand spend a lot more time on the programming part - and in counterpart, have a much more significant sense of achievement when they complete the game.

It's kind of introductory material, it sets a ground level for Chapter 2 - if you can't be bothered to sit (or run) through Chapter 1 you probably won't find the next one interesting.


--The more you have it, the less you see. What is it?

And I answered Cataracts. And wasn't correct.


Did you try blindness? For cataracts, you would expect the question to ask "The more you have them, the less you see. What are they?". I mean if you happened to ask someone if they have cataracts, it'd sound a little odd if they said "yeah I have it".


Very nice! Looking forward to seeing what interesting puzzles Chapter 2 provides.


For the one were you are supposed to ask the guard (xzoor) for the key I keep getting the error Property 'door' of object # is not a function - Try again.

Otherwhise looks cool, plus I've always wanted to learn CoffeeScript, so thanks!


Sure, that was example code - do you really expect the game to give you the solution by itself? :)


I know it's kind of defeating the purpose, but it would be nice to be able to skip and see the answer to the question. Most of these step through games usually let you do that, although those are made for weaklings.


Also, I think the append method for the @log is getting exposed. I tried to do something (who knows now) and it said append was not a method which I assume is coming from one of the @log.append


You're playing Episode 2 from within Episode 1. What are you doing playing the game you should fork it already.


Do you mind adding the build instructions to the README so I can run it locally? Rails holds my hand with coffeescript and I dunno anything just from looking at the Makefile.


Basically just running 'make' will produce all the needed files in output/. Then you can use 'python -m SimpleHTTPServer' from the output server, and open http://localhost:8000/ in your favorite browser.

For make to run correctly you'll need the haml, sass, and juicer gems installed and in your path.


You answered your own question :)

Lots of people cheated their way through without admitting to it. But the government sees everything...


This is awesome. How about a version that records the interaction? Would be great for interviewing programmers! Like a fun version of interviewzen.com.


Chrome crashed that tab after the first problem- but that happening was kinda surreal. At first I thought it was part of the game ;)


I saw `answer '...'` and immediately guessed... coffee-script? Syntax highlighting confirmed this ;)


Well played sir/madam/robot.


If you are wondering what the methods on an object are, use this.

keys = (k for k, v of obj when typeof v is 'function')

alert(keys)


Got this: EEM: Object NaN has no method 'toLowerCase' - Try again. :-)


You're probably at the beginning of the game, and you probably need to put your answer within single quotes (e.g. answer 'yes'). Not much error checking yet..


It's really irritating that the syntax is incorrect in some examples.



I am stuck at the Xena and Xzoor part anyone want to help me?


for the door question, you should support: open @door, @xzoor.askKey(@door)


Thanks for the feedback.

See https://news.ycombinator.com/item?id=5795893 for context - window.open gets called on 'open'. If any HNers have ideas for restricting what gets called, I'm all ears.

Source is on GitHub, at https://github.com/nddrylliog/thechoice


Can't you do something like

    eval("function() { var open = unlock; " + expression + " }")();
? (I haven't looked at your code.)


Sorry, I wasn't clear (and I think I meant "unlock", not "open").

I meant that you should support skipping temporary variables.


Oh. See that's another game design decision.

Nothing prevents you from typing:

  unlock @door, <action to get the key>
But when doing user testing, lots of non-coders got stuck at this point. It's clearer to them when things happen one after the other.

So, if I can find a good way to teach them that when you do a(b(c))) first, b is called first, then a with the return value of b - without making a lenghty tutorial-type explanation, I'll do it.

In the meantime, this'll do :)


it was easy for me, but really fun, I want more of this for sure..


I'm on it.


answer '<script>alert("xss")</script>'


bug: ---------

answer 1

EEM: raw.toLowerCase is not a function - Try again.


Is this a programming language?

Why not use a programming language?


It's coffeescript[1]

[1] http://coffeescript.org/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: