Skip to content

Instantly share code, notes, and snippets.

View fzlittlerabbit's full-sized avatar

fzlittlerabbit

View GitHub Profile
@fzlittlerabbit
fzlittlerabbit / Swift Playground: Roll Right, Roll Left
Created October 10, 2025 14:07
I just started to learn coding via Swift Playground. I found this level is quite challenging, and I'd like to learn how to optimize the code.
func toggleorcollect() {
if isOnGem {
collectGem()
} else if isOnClosedSwitch && isBlocked {
turnLeft()
toggleSwitch()
} else if isOnClosedSwitch{
toggleSwitch()
}
}