Choose Your Own Adventure assignment submission#13
Choose Your Own Adventure assignment submission#13codeblahblah wants to merge 2 commits intoRubyoffRails:masterfrom
Conversation
|
@jwo Essentially you're given a choice to "win"? |
Gemfile
Outdated
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. |
|
@jwo "Yes, that's the way it is designed. If you ever reach a conclusion, the game should conclude." |
puts " - [#{book.current_page.options.first.content}]"
puts " - [#{book.current_page.options.last.content}]"What happens if there is only one option in the |
|
@jwo The first and last options are the same object. |
|
|
|
If you added something like this, it should work the way you want until book.complete_game? do
book = book.current_page.options.first if book.current_page.options.count == 1 |
|
@jwo Not working. Results in an infinite loop on the first choice. |
|
(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: