doc: sample: switch to kebab-case

This commit is contained in:
2025-11-07 10:07:44 +00:00
parent c8f0be14a1
commit 77791d91e3
9 changed files with 66 additions and 67 deletions

View File

@@ -3,8 +3,8 @@ package net.doorstuck.vehicles
protocol Vehicle
- startup
- shutdown
- nrWheels
- nrDoors
- nr-wheels
- nr-doors
- turn(direction:dir)
- accelerate(direction:dir)
- velocity
@@ -12,33 +12,33 @@ end
class Car <Vehicle>
- startup
self.engineRunning = true
self.engine-running = true
end
- shutdown
self.engineRunning = false
self.engine-running = false
end
- nrWheels
- nr-wheels
^4
end
- nrDoors
- nr-doors
^4
end
- turn(direction:dir)
self.currentDirection = dir
self.current-direction = dir
end
- accelerate(direction:dir)
match dir
#forward => self.currentVelocity += 1,
#backward => self.currentVelocity -= 1,
$forward => self.current-velocity += 1,
$backward => self.current-velocity -= 1,
end
end
- velicity
^self.currentVelocity
- velocity
^self.current-velocity
end
end