1
0
dust/examples/sea_creatures.ds

20 lines
343 B
Plaintext
Raw Permalink Normal View History

2024-01-01 12:46:47 +00:00
raw_data = fs:read('examples/assets/seaCreatures.json')
sea_creatures = json:parse(raw_data)
2023-10-23 20:12:43 +00:00
data = {
creatures = []
total_clams = 0
dolphin_clams = 0
}
for creature in sea_creatures {
2023-11-15 01:00:57 +00:00
data:creatures += creature:name
data:total_clams += creature:clams
2023-10-23 21:36:11 +00:00
2023-11-15 01:00:57 +00:00
if creature:type == 'dolphin' {
data:dolphin_clams += creature:clams
2023-10-23 20:12:43 +00:00
}
}
data