
Show HN: The Choice – An online programming puzzle RPG - nddrylliog
http://thechoice.amos.me/
======
matchu
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.

~~~
effbott
'guard' is just a placeholder. Try typing

    
    
        key = @xzoor.askKey(@door)

~~~
matchu
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.

------
lukifer
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)

~~~
nddrylliog
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.

~~~
potench
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.

------
jtokoph
This is like the programming version of the Portal games.

~~~
nddrylliog
<3

------
nddrylliog
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 ;)

~~~
breadbox
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.)

~~~
nddrylliog
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.

~~~
jheimark
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).

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

------
coryl
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.

~~~
nddrylliog
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.

------
Zimahl
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.

~~~
nddrylliog
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.

~~~
Zimahl
_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.

~~~
tempestn
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.

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

------
millzlane
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.

------
arh68
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.

~~~
nddrylliog
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".

------
Gurrewe
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?

~~~
nddrylliog
See <https://news.ycombinator.com/item?id=5795893>

------
eridius
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.

~~~
nddrylliog
No sound version: <http://thechoice.amos.me/?nosound>

------
Zimahl
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!

~~~
nddrylliog
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.

------
fragmede
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.

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

~~~
nddrylliog
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.

------
chrisfarms
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)

~~~
nddrylliog
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.

~~~
abecedarius
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.)

------
Fuzzwah
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.

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

~~~
nddrylliog
See <http://coffeescript.org/#loops> for reference.

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

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

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

------
shurcooL
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?

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

------
antoinec
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".

~~~
nddrylliog
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?

~~~
antoinec
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 :)

------
xauronx
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!

------
grannyg00se
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.

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

~~~
nddrylliog
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.

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

And I answered Cataracts. And wasn't correct.

~~~
jwdunne
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".

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

------
natsas
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!

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

------
hablahaha
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.

~~~
hablahaha
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

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

~~~
hablahaha
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.

~~~
nddrylliog
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.

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

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

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

~~~
nddrylliog
Well played sir/madam/robot.

------
nixpulvis
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)

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

~~~
nddrylliog
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..

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

~~~
whimsy
<https://github.com/nddrylliog/thechoice/pull/3> :)

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

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

~~~
nddrylliog
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>

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

I meant that you should support skipping temporary variables.

~~~
nddrylliog
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 :)

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

~~~
nddrylliog
I'm on it.

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

------
jisaacstone
bug: \---------

answer 1

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

------
Siecje
Is this a programming language?

Why not use a programming language?

~~~
AntiRush
It's coffeescript[1]

[1] <http://coffeescript.org/>

