-
Notifications
You must be signed in to change notification settings - Fork 28
Programming Guidelines
Asa Sprow edited this page Dec 5, 2020
·
1 revision
func computerTime(d):
func computeTime(daysElapsed):
obj.fetch()
thing.Get()
obj.get()
thing.get()
timerIncrement()
incrementTimer()
# TODO
setTime()
# TODO: add timezones
setTime()
if (a ==1):
doSomething()
elif (a == 2)
doSomethingElse()
elif (a ==3)
doYetAnotherThing()
else
doDefaultThing()
match a:
1:
doSomething()
2:
doSomethingElse()
3:
doYetAnotherThing()
_:
doDefaultThing()
if objectExists():
if objectIsGreen():
if objectIsMoving():
return true
else:
return false
else:
return false
else:
return false
if not objectExists():
return false
if not objectIsGreen():
return false
if not objectIsMoving():
return false
return true
var colors = {1: "green", 2: "red", 3: "orange", 4: "purple"}
var colors = {}
colors[1] = "green"
colors[2] = "red"
colors[3] = "orange"
colors[4] = "purple"
Players[i].player.inventory += item
Players[current].AddInventoryItem(item)
func doSomethingComplex:
# Setup
[ 30 lines of code ]
# Process
[ 60 lines of code ]
# Cleanup
[ 20 lines of code ]
func doSomethingComplex:
var values = setup()
process(values)
cleanup()
process(obj1)
process(obj2)
process(obj3)
for obj in [obj1, obj2, obj3]:
process(obj)