Y
Hacker News
new
|
ask
|
show
|
jobs
by
ENGNR
3511 days ago
while(sugar = 0) seekFood()
And thus the grey goo was created
1 comments
majewsky
3510 days ago
Hm no, you used = instead of ==, so this will never seek food. ;)
link
smarinov
3510 days ago
You probably mean that it will
always
seek food since the assignment evaluates to 'true' when it's successful (which is usually the case).
link
TeMPOraL
3510 days ago
In what language? In all that I know, assignment evaluates to the value that was assigned (that is, if it evaluates to anything at all). Also in most languages that look like C, 0 evaluates to false. Therefore it will
never
seek food.
link
saynsedit
3510 days ago
Usually the case as in usually never the case.
link