V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
这是一个专门讨论 idea 的地方。

每个人的时间,资源是有限的,有的时候你或许能够想到很多 idea,但是由于现实的限制,却并不是所有的 idea 都能够成为现实。

那这个时候,不妨可以把那些 idea 分享出来,启发别人。
wojiuyuna1980

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

  •  
  •   wojiuyuna1980 · Jun 25, 2018 · 2845 views
    This topic created in 2870 days ago, the information mentioned may be changed or developed.
    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"
    }
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2388 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 05:43 · PVG 13:43 · LAX 22:43 · JFK 01:43
    ♥ Do have faith in what you're doing.