Last active
August 11, 2018 20:10
-
-
Save topherPedersen/7c5d91fd0129ef6e6ecf82f9dbe2dfa9 to your computer and use it in GitHub Desktop.
Rock, Scissors, Paper (Swift Edition by Shruthi)
This file contains hidden or 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
| // (WORK IN PROGRESS) | |
| // Rock, Scissors, Paper by Shruthik-- a rockstar | |
| // programming student at theCoderSchool in Flower Mound, TX | |
| import Foundation | |
| print(" GAME OF ROCK, SCISSORS, PAPER") | |
| print(" CREATIVE COMPUTING MORRISTOWN, NEW JERSEY") | |
| print(" ") | |
| print(" ") | |
| print("HOW MANY GAMES") | |
| var userInput: String = readLine()! | |
| // print("GAME NUMBER\(userInput)") // echo userInput | |
| print("3 = ROCK...2 = SCISSORS...1 = PAPER") | |
| print("1...2...3...WHAT'S YOUR CHOICE") | |
| var userInput2: String = readLine()! | |
| // TODO: Shruthi, please generate a random number between 1 and 3 | |
| let randomNumber: UInt32 = arc4random_uniform(3) + 1 | |
| // TODO: Shruthi, create an if-else statement which will print either: | |
| // THIS IS MY CHOICE... ROCK | |
| // THIS IS MY CHOICE... SCISSOR | |
| // THIS IS MY CHOICE... PAPER | |
| if randomNumber == 1 { | |
| print("THIS IS MY CHOICE... ROCK") | |
| } else if randomNumber == 2 { | |
| print("THIS IS MY CHOICE... SCISSOR") | |
| } else { | |
| print("THIS IS MY CHOICE...PAPER") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment