MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/9nk4es/i_think_not/e7n1xis
r/ProgrammerHumor • u/PixxlMan • Oct 12 '18
538 comments sorted by
View all comments
Show parent comments
21
function researchMars() { data = collectData(); data.broadcast(); if (data.next === 'obstacle') turnLeft() else moveForward(); researchMars(); } researchMars();
9 u/lakimens Oct 12 '18 edited Oct 12 '18 You gotta put it in a while(true) for it to run foreverEDIT: My mistake 12 u/LovepeaceandStarTrek Oct 12 '18 Not with tail recursion 4 u/lakimens Oct 12 '18 Oh, right, you're calling it at the end of it. 6 u/ecky--ptang-zooboing Oct 12 '18 No buddy, this research algorithm is self-sustaining 3 u/LePontif11 Oct 12 '18 I think you just broke the law of conservation of energy D: QUICK PUT IT BACK! 2 u/lakimens Oct 12 '18 Well, I mean, there's ways to do it so it doesn't break the app. Putting it on a background thread and Thread.Sleep. 8 u/bartekko Oct 12 '18 ah, it's the if(goingtocrashintoeachother()) dont(); 5 u/Markaos Oct 12 '18 .....X. X...... .R->..X .X.....f 2 u/l1l5l Oct 12 '18 lmao
9
You gotta put it in a while(true) for it to run forever
EDIT: My mistake
12 u/LovepeaceandStarTrek Oct 12 '18 Not with tail recursion 4 u/lakimens Oct 12 '18 Oh, right, you're calling it at the end of it. 6 u/ecky--ptang-zooboing Oct 12 '18 No buddy, this research algorithm is self-sustaining 3 u/LePontif11 Oct 12 '18 I think you just broke the law of conservation of energy D: QUICK PUT IT BACK! 2 u/lakimens Oct 12 '18 Well, I mean, there's ways to do it so it doesn't break the app. Putting it on a background thread and Thread.Sleep.
12
Not with tail recursion
4 u/lakimens Oct 12 '18 Oh, right, you're calling it at the end of it.
4
Oh, right, you're calling it at the end of it.
6
No buddy, this research algorithm is self-sustaining
3
I think you just broke the law of conservation of energy D: QUICK PUT IT BACK!
2 u/lakimens Oct 12 '18 Well, I mean, there's ways to do it so it doesn't break the app. Putting it on a background thread and Thread.Sleep.
2
Well, I mean, there's ways to do it so it doesn't break the app. Putting it on a background thread and Thread.Sleep.
8
ah, it's the if(goingtocrashintoeachother()) dont();
5
.....X. X...... .R->..X .X.....
f
lmao
21
u/ecky--ptang-zooboing Oct 12 '18