生命系统的模型,大家可以看懂吗

2018-06-25 11:29:25 +08:00
 wojiuyuna1980
LIFE A
//function: eat,find,consume,discharge
//find while true return(call consume in each loop)
//eat=material+ and energy+
//find,discharge=material- and energy-

material food<-find->LIFE A->eat->[material x(100),energy y(99)]->[consume(material x(5),energy y(3)),discharge(material x(3),energy y(1))]

if A.material>10 ‖ A.energy>5{
return "healthy"
}else if(A.material>0 ‖ A.energy>0){
return "alive"
}else{
return "game over"
}
2088 次点击
所在节点    奇思妙想
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/465589

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX