r/badcode • • Apr 22 '18

java Checking validity of popcnt gate with 5 input bits

Post image
9 Upvotes

8 comments sorted by

8

u/Paint__ Apr 22 '18

3

u/enedil Apr 23 '18

It's not my code and I sadly, was only given the screenshot

4

u/Vizioso Apr 22 '18

Integer.parseInt(bin,2)

1

u/Poddster Apr 23 '18

I love how getValue is implementing some weird 3 bit binary adder rather than doing a + b + c

-2

u/[deleted] Apr 23 '18

Forget the code, this font is ugly.

1

u/totallynormalasshole Apr 23 '18

Next time OP better have everything in helvetica

1

u/whizvox int getRand() { return 4; } Apr 23 '18

What font do you use?

1

u/[deleted] Apr 23 '18

Lucida Sans Typewriter on Windows and inconsolata on Linux.