Κώδικας: Επιλογή όλων
to aa
; file bankacc.in must be in the same directory with the LGO file
make "bank9 {0 0 0 0 0 0 0 0 0}
OPENREAD "bankacc.in
SETREAD "bankacc.in
MAKE "how_many_lines READWORD
REPEAT :how_many_lines [xx READLIST]
SETREAD []
CLOSE "bankacc.in
end
to dd :numbers
make "euro_before item (first :numbers) :bank9
make "euro_after (last :numbers)+:euro_before
setitem (first :numbers) :bank9 :euro_after
print "s
end
to qq :acc
show item :acc :bank9
end
to ww :numbers
make "euro_before item (first :numbers) :bank9
make "euro_after :euro_before-(last :numbers)
ifelse :euro_after<0 [print "f] [setitem (first :numbers) :bank9 :euro_after print "s]
end
to xx :dwq
if (first :dwq)= char 100 [dd butfirst :dwq]
if (first :dwq)= char 119 [ww butfirst :dwq]
if (first :dwq)= char 113 [qq last :dwq]
end
to zzz
ifelse YesNoBox [Welcome] [NAI run the code, OXI show me the code] [aa] [edall]
end
Make "startup [zzz]
Κώδικας: Επιλογή όλων
8
d 6 1000
q 4
d 4 500
q 4
w 4 750
w 6 200
q 6
q 4
Κώδικας: Επιλογή όλων
s
0
s
500
f
s
800
500