-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Choose Your Own Adventure assignment submission #13
base: master
Are you sure you want to change the base?
Conversation
@jwo Essentially you're given a choice to "win"? |
@@ -4,4 +4,5 @@ gem 'rake' | |||
gem 'rspec' | |||
gem 'activesupport' | |||
gem 'activerecord' | |||
gem "sinatra-activerecord" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is needed
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 [email protected] 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: