Once was watching a documentary film about this, life can be represented with a some simple lines of code. We gather information and make decision based on that information. Do you know the name of that documentary movie ?At very high level how would you implement our life ?
const answer = 42;
Go figure. :D
function life() {
while (awake) {
work()
}
}
here's my routine ^
If you're looking for something like genetic coding, my best experiment is here, it's not that exciting: codepen.io/tomhodgins/pen/LRpvYj
But, if you're looking for a tiny version of the 'Game of Life', check this out:
<body onkeyup="a=b;b=[h='<pre>'];for(i=40;i--;h+='\n')for(j=80;j
--;){k=80*i+j;d=0;for(z in e=[1,79,80,81])d+=a[k+e[z]]+a[k-e[z]]
;h+='<a onclick=innerHTML=q[b['+k+']^=1]>'+q[b[k]=3==d|a[k]&2==d
]}innerHTML=h"onload=f.onkeyup(b=q=".@") id=f>
something along the lines of
f () {
if (theEnd() === true) {
die()
} else {
eatAndDrink()
habitGenerator()
|> doStuff(habit)
|> doILikeIt(outcome)
|> addOrRemoveHabit(yesOrNo)
}
f()
}
Ibrahim Tanyalcin
{intrst:"Scnc&Art",msc:"admin@MutaFrame",strive:"Experiment&Learn",loves:"ES5",hates:"bandwagon",lang:"Javascript",twttr:"@ibrhmTanyalcin"}
All I know is I know nothing:
!(NaN === NaN) story