-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapocalypse.spd
More file actions
executable file
·47 lines (39 loc) · 1.01 KB
/
apocalypse.spd
File metadata and controls
executable file
·47 lines (39 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/local/bin/spd
class Country
|int| Population
|int| ATP
|string| name
constructor (|string| Name)
.name = name
.population = random[40, 100]|int|
.ATP = random[4, 12]|int|
"$name was founded with $.population population and $.ATP power"
function Attack (|Country| other)
|| oth = ("itself", other.name)(self == other)
"$.name attacks $oth"
other.Damage .ATP
if other != self
.Damage other.ATP
function Damage (|int| damage)
.population -= damage
if .population > 0
"$.name loses ${damage}m pop. Now has ${.population}m pop."
else
"$.name loses ${damage}m pop and died :("
function Alive (|bool|)
return .population > 0
main
|[country]| Europe
"\nWelcome to Europe Simulator 2000!!"
|| names = "Netherlands/United Kingdom/France/Germany/Italy" / '/'
for s in names
Europe <~ Country(s)
printline
while Europe
for (cu.backwards in Europe) (i)
cu.Attack Europe[]!
if !cu.alive
Europe.remove(i)
printline
app.sleep(0.2s)
"Europe is gone."