Skip to content

Commit

Permalink
Completed the 4th module and the dice project.
Browse files Browse the repository at this point in the history
  • Loading branch information
Piyush023 committed Aug 21, 2024
1 parent 0ec507e commit 38f54ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,4 @@
uuid = "5FB173CD-6638-4C1E-B86D-8248336E181E"
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "8C266ADA-98F3-48BD-B562-5AA4694F743F"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Dicee-iOS13/ViewController.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "30"
endingLineNumber = "30"
landmarkName = "rollButtonPressed(_:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
16 changes: 7 additions & 9 deletions Dicee-iOS13/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,19 @@ class ViewController: UIViewController {
var image2Index = 5

override func viewDidLoad() {
super.viewDidLoad()
diceImageView1.image = UIImage(named: "DiceSix")
// super.viewDidLoad()
// diceImageView1.image = UIImage(named: "DiceSix")
// diceImageView1.alpha = 0.4
diceImageView2.image = UIImage(named: "DiceTwo")

// diceImageView2.image = UIImage(named: "DiceTwo")
//
}

@IBAction func rollButtonPressed(_ sender: UIButton) {
// Arrays - Intro - 14/08 -
// Arrays - Intro - 14/08 -
let diceImageView1Array = [UIImage(named: "DiceOne"), UIImage(named: "DiceTwo"), UIImage(named: "DiceThree"), UIImage(named: "DiceFour"), UIImage(named: "DiceFive"), UIImage(named: "DiceSix")]
diceImageView1.image = diceImageView1Array[image1Index]
image1Index = image1Index + 1
diceImageView1.image = diceImageView1Array[Int.random(in: 0...5)]

diceImageView2.image = diceImageView1Array[image2Index]
image2Index = image2Index - 1
diceImageView2.image = diceImageView1Array[Int.random(in: 0...5)]
}

}
Expand Down

0 comments on commit 38f54ea

Please sign in to comment.