So, I'm currently learning Swift (with no programming experience at all) with Swift Playgrounds.
I am currently on Learn To Code 2 at the level Round Up the Switches.
My solution for this level was:
Read more
I am currently on Learn To Code 2 at the level Round Up the Switches.
My solution for this level was:
Swift:
var numberOfGems = 0
var numberOfSwitches = 0
func checkTile() {
if isOnGem {
collectGem()
numberOfGems += 1
}
if isOnClosedSwitch {
toggleSwitch()
numberOfSwitches += 1
}
}
func checkWhereToGo() {
if isBlocked {...
Read more