Adjusted RPS related actions
This commit is contained in:
@@ -696,7 +696,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="374" height="170"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="person.crop.circle.badge.checkmark" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="yVW-fL-SIQ">
|
||||
<rect key="frame" x="130.5" y="0.0" width="111.5" height="109.5"/>
|
||||
<rect key="frame" x="132" y="0.0" width="110" height="109.5"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="110" id="So8-k5-nLS"/>
|
||||
<constraint firstAttribute="height" constant="110" id="inA-vb-CrL"/>
|
||||
|
||||
@@ -175,7 +175,7 @@ class RPS {
|
||||
else if you == .paper && computer == .rock { return true}
|
||||
else if you == .scissors && computer == .paper { return true }
|
||||
else {
|
||||
return playRPS(you: you, computer: RPS.randomComputerChoice())
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,10 +15,12 @@ func walkAction() {
|
||||
}
|
||||
|
||||
func jumpAction() {
|
||||
let rps = RPS()
|
||||
|
||||
}
|
||||
|
||||
func rpsAction() {
|
||||
func rpsAction(choice: RPS.Choice) -> Bool? {
|
||||
let rps = RPS()
|
||||
return rps.playRPS(you: choice, computer: RPS.randomComputerChoice())
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user