Created
November 15, 2013 20:33
-
-
Save ashleygwilliams/7491101 to your computer and use it in GitHub Desktop.
Create a folder called 'games' in your todos repo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Blackjack! | |
##Objective | |
#Practice contional logic including nested conditionals. | |
#Use methods to keep our code DRY. | |
##Instructions | |
#We are going to build a command line blackjack game. A player gets dealt two cards which have values between 1-11. After they get dealt two cards you should show them the total score of their cards and ask them if they want to hit or stay. A player is allowed to "hit" up to two times. After each hit you should ask if they want to hit or stay and display the total value of their cards. If they don't want to hit, and they are not at 21 they lose. Your program should tell them they lose and exit. | |
#Note: To take input from the person "playing" the game your program will have to use the Ruby method "gets". | |
##Challenge | |
#After successfully completing the previous game (there should be a commit with a working version of this game), alter the game so that a player can "hit" as many times as they want. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Magic 8-Ball | |
##Objective | |
#Use methods to keep our code DRY. | |
##Instructions | |
#Build a ruby program that when run will ask the user if they want to shake the eight ball. | |
#If the user answers yes, have it give a random message. | |
#If the user says no, have it end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment