MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/1387lr6/traveling_salesman_solution/
r/badcode • u/[deleted] • May 05 '23
10 comments sorted by
22
yanderedev would be so proud of this
1 u/Inaeipathy May 06 '23 Brings a tear to my eye. I mean I write bad code but man, this is truly a gem. 2 u/thatoneguy127383 May 06 '23 Definitely not a tear of joy
1
Brings a tear to my eye. I mean I write bad code but man, this is truly a gem.
2 u/thatoneguy127383 May 06 '23 Definitely not a tear of joy
2
Definitely not a tear of joy
6
All we need now is a recursive for loop that this is called from
Image Transcription: Code
if(i == 0) { if(j == 0) { ft += ab; ft += bc; ft += hc; times.put("HAB", ft); ft = ha; } else { ft += ab; ft += bc; ft += hc; times.put("HAC", ft); ft = 0; } } else if(i == 1) { if(j == 0) { ft += ab; ft += ac; ft += hc; times.put("HBA", ft); ft = hb; } else { ft += bc; ft += ac; ft += ha; times.put("HBC", ft); ft = 0; } } else { if(j == 0) { ft += ac; ft += ab; ft += hb; times.put("HCA", ft); ft = hc; } else { ft += bc; ft += ab; ft += ha; times.put("HCB", ft); ft = 0; }
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
Where is my shotgun?
3
I would like to see the entire function. It's tough to know what this is doing without that context.
Even the code creator have to think what the hell he did there.
ft could be a bit more descriptive
2 u/Key_Conversation5277 sadistic May 06 '23 Probably it's feet? Although dist would be a lot better
Probably it's feet? Although dist would be a lot better
22
u/thatoneguy127383 May 05 '23
yanderedev would be so proud of this
6
u/[deleted] May 05 '23
All we need now is a recursive for loop that this is called from
6
u/MurdoMaclachlan public boolean isInt(int i) { return true; } May 05 '23
Image Transcription: Code
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
6
u/Demiyanit May 05 '23
Where is my shotgun?
3
u/tedbradly May 05 '23
I would like to see the entire function. It's tough to know what this is doing without that context.
2
u/RootU5R May 06 '23
Even the code creator have to think what the hell he did there.
1
u/[deleted] May 05 '23
ft could be a bit more descriptive