Skip to content
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

StevenC Adventure #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions SCadgame.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
require 'rubygems'
require 'artii'
require 'rubocop'

num = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]

print "~~~~~~Choose Your Own Adventure Game~~~~~~".center(80)
print "Welcome. To the world of mystery. Where you get to decide. \n".center(80)
print "Are you ready? Y||N \n".center(60)

input = gets.chomp
input.downcase!


if input == 'y'

puts "Here we go.\n".center(80)
puts "Please enter your name: \n".center(80)
user_name = gets.chomp
user_name.upcase!
puts "Your name is #{user_name}. Welcome, #{user_name}!!!".center(80)

elsif input == 'n'

puts 'Alright. Maybe another time.'.center(80)

else

num.each do |n|

puts "Huh. I did not understand. Please try again. Remember, Y||N #{n} tries remaining.\n".center(80)
input = gets.chomp
input.downcase!

if n == 1
print "Time out. Next Time."

end
end
end

if input == 'y'

print "Welcome to awesome time.".center(80)
end
3 changes: 3 additions & 0 deletions SCadgameREADME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is an incomplete file. It is missing the main game. It has a simple setup by asking the user if they want to play using 'y' or 'n'. It also askes the user for their name. This code will be optimized as time goes. This is just sample code and a preview of whats to come. Later down the line, classes will be used and different rb files. This ensures more readability. Rules and description will be added.

![Alt Text](http://sd.keepcalm-o-matic.co.uk/i/keep-calm-and-stay-tuned-25.png)