|
I am confused about the Rock Paper Scissor Challenge here: https://www.hackingwithswift.com/guide/ios-swiftui/2/3/challenge
Why is the app prompting the player to win or loose? You win or loose rock paper scissors based on a comparison between the players choices, as far as I know.
Why is the app choosing win or loose? I am unclear on the game logic, in my mind the computer would pick either rock paper or scissors, and then based on what the user picks either the user would win or loose. I think I am reading something wrong or just missing the point. Thanks! |
|
The challenge is asking you to modify your code so that the player scores a point if they match the requested outcome - win or lose the round against the computer. Otherwise the player loses a point. |
|
Imagine that it's a game of "Simon Says..." - So the app choosing Win/Lose is like "Simon Says Win" or "Simon Says Lose".. So if Simon Says Win and the App chooses Rock, the Player should chose Paper to Win. But if Simon Says Lose, then the player should chose Scissors to lose to Rock. |
|
If you were just making a classic Rock, Paper, Scissors game, then you would be right. You wouldn't want to make the app randomly decide when a player should win or lose. Instead, you would hide the computer's selection until after the player had made their selection, and then let them know if they won or lost. However, in this project Paul is asking us to create a version of the game with a twist. The player gets to see the computer's selection in advance. So, in order to make the game any kind of challenge at all, the player has to pay attention to whether they should be trying to win or lose to their opponent, and select the appropriate response each time. It still isn't much of a challenge. But it at least makes the player think more than they would have to if they were just playing a game of Rock, Paper, Scissors where they always go second. |
|
@FlyOstrich @Azzaknight Thanks for the responses, I almost get but also dont understand why this would be done this way, and cant quite grasp the game logic. I think I am having trouble wrapping my head around making a rock paper scissors game that isn't a rock paper scissors game. Is it supposed to be a variation on the Flags game? |
|
There really is no reason to make the game this way other than it was what we were instructed to do. I think the idea was basically just to give you a new challenge. If you were asked to create a classic "Rock, Paper, Scissors" game then it would have basically been exactly like creating the "Guess the Flag" game. But Paul wanted to throw an extra difference in just to make sure that you understand how the code in the "Guess the Flag" game works well enough to be able to modify it a bit. I don't think that there is any reason beyond that for why a person would want to make the game work in this way. |
|
SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.