Swift — Twin Peaks
Objective: Character collects all gems until count is equal to randomized total, while expert moves platform as needed.
Not only was this a very challenging level, utilizing all skills practiced until now, it also tested some erroneous assumptions I falsely introduced.
At first, I assumed that gems may also appear along the entire length of the platform, which they did not; gems only ever appeared on the ends.
Secondly, I assumed platform must be raised to an even level with each row, which it does not; only must get within jumping level. (Thanks, Samantha!)
Difference between mine and hers? 47 lines vs 31 — mine has 50% more!!
My solution
let expert = Expert()
let character = Character()
var gemCount = 0
world.place (expert, facing: north, atColumn:1, row:3)
world.place (character, facing: north, atColumn:5, row:0)
func rowRun() {
for i in 1…6 {
if...