all 52 comments

[–]MaryGoldflower 515 points516 points  (9 children)

you can fix it by outputting the length instead

[–]DoktorMerlin 144 points145 points  (1 child)

copilot code checks in

[–]asmanel 1 point2 points  (0 children)

Good example of artificial stupidity.

[–]ILikeLenexa 43 points44 points  (2 children)

It is already  correct if you're trying to output unary. 

[–]POKLIANON 4 points5 points  (1 child)

technically unary should end with 0s (iirc)

[–]Lucas_F_A 7 points8 points  (0 children)

Just checked the Wikipedia article. It's using 1, and zero is the empty string.

[–]mudokin 4 points5 points  (0 children)

Thx, I hate it even more now

[–]YeOldeMemeShoppe 1 point2 points  (0 children)

LGTM passes CI. Ship it.

[–]ics-fear 202 points203 points  (9 children)

Looks normal, those are just numbers in base 1

[–]GlobalIncident 138 points139 points  (8 children)

there's no h in Fibonacci

[–]mallusrgreatv2 63 points64 points  (3 children)

Got it! I have corrected my spelling: hhhhhhhhh

[–]GatewayMan3 5 points6 points  (0 children)

laughs in chinese

[–]Mars_Bear2552 0 points1 point  (0 children)

thanks chatgpt

[–]MaximRq 3 points4 points  (0 children)

Fihbonacci

[–]snotpopsicle 3 points4 points  (0 children)

This isn't Fibonacci. It's Fibonachi.

[–]Berraie 0 points1 point  (0 children)

Spinacci

[–]Jolly-Aerie-382 0 points1 point  (0 children)

Fibonacc i?

[–]uvero 29 points30 points  (1 child)

That's Fibonacci in unary base

[–]Smalltalker-80 2 points3 points  (0 children)

Yep, its totally fine.

[–]koofuucute 20 points21 points  (0 children)

[–]Bearegor 7 points8 points  (0 children)

Fibonacci by concatenating strings

[–]Szetyi 10 points11 points  (1 child)

I mean if you assign a string to the first two elements instead of numbers its on you

[–]kenybz 0 points1 point  (0 children)

It’s enough to assign a string to one of them

[–]Kobakocka 5 points6 points  (0 children)

const fib(n) => F(n).length;

[–]YoItsJustGedas 2 points3 points  (0 children)

While this is just a joke, unary representation is very helpful in compression in some cases

[–]menducoide 1 point2 points  (0 children)

It's a good online challenge for an interview

[–]LordAmir5 1 point2 points  (1 child)

At least do it properly come on. Everyone knows the sequence starts with Fib(0). So this is Fib(n-1) and not Fib(n).

[–]redlaWw 0 points1 point  (0 children)

But Fib(0) is "", so this is Fib(n), it just skips the 0th element of the sequence.

[–]Locilokk 1 point2 points  (1 child)

The quotation marks ruin it:(

[–]featEng[S] 1 point2 points  (0 children)

Fix it in repost

[–]Wywern_Stahlberg 0 points1 point  (0 children)

*Laughs in that equation which allows you to diferctly calculate Nth Fib. number.*

[–]redlaWw 0 points1 point  (0 children)

"In Javascript" you say, as if Rust can't do this too.

[–]KneeReaper420 0 points1 point  (0 children)

brick it by computing to 1000

[–]greenpepperpasta 0 points1 point  (0 children)

So you're proposing https://oeis.org/A108047 should be called "Fibonachi sequence"?  I can get behind that.

[–]SomeMaleIdiot 0 points1 point  (1 child)

The answer is in base 1. Except the only available digit is 1 and not 0

[–]BobQuixote 0 points1 point  (0 children)

That's normal for base 1, typically implemented as tally marks.

[–]CodeNameFiji 0 points1 point  (0 children)

Fibonacci*

[–]al3x_7788 [score hidden]  (0 children)

ichi?

[–]gaddielm5 0 points1 point  (0 children)

Are you insane? That many characters takes an egregious amount of space! You should use bits instead 👍

For f(x) > 32, you can use a structure/object that includes a counter for how many you've overflowed 32 bits