Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift while Loop to Display Game Level

var currentLevel:Int = 0, finalLevel:Int = 5
let gameCompleted = true
while (currentLevel <= finalLevel) {

  if gameCompleted {
    print("You have passed level (currentLevel)")
      currentLevel += 1
  }
}
print("Level Ends")
 
PREVIOUS NEXT
Tagged: #Swift #Loop #Display #Game #Level
ADD COMMENT
Topic
Name
8+6 =