Uh oh!
There was an error while loading. Please reload this page.
Choose Your Own Adventure assignment submission - #13
Conversation
codeblahblah
commented
Apr 9, 2014
@jwo Essentially you're given a choice to "win"? |
jwo
commented
Apr 9, 2014
Yes, that's the way it is designed. If you ever reach a conclusion, the game should conclude.
No. I ask you to do that so that a page could have more than one parent. |
codeblahblah
commented
Apr 9, 2014
@jwo "Yes, that's the way it is designed. If you ever reach a conclusion, the game should conclude." |
jwo
commented
Apr 9, 2014
puts" - [#{book.current_page.options.first.content}]"puts" - [#{book.current_page.options.last.content}]"What happens if there is only one option in the |
codeblahblah
commented
Apr 9, 2014
@jwo The first and last options are the same object. |
jwo
commented
Apr 9, 2014
|
codeblahblah
commented
Apr 9, 2014
|
jwo
commented
Apr 9, 2014
If you added something like this, it should work the way you want untilbook.complete_game?dobook=book.current_page.options.firstifbook.current_page.options.count == 1 |
codeblahblah
commented
Apr 9, 2014
@jwo Not working. Results in an infinite loop on the first choice. |
jwo
commented
Apr 9, 2014
(It's your code, you'll need to make it work) On Wed, Apr 9, 2014 at 5:27 PM, drammopo notifications@github.com wrote:
|
@jwo The Book#complete_game? does not work in that it also gives the conclusion as selectable "option".
I.e. You have to be on the actual last page which has
Page.create(conclusion: true,...before the loop exits.Is that why the Eagle Assignment ask to: