1

Befunge isn't used much outside of code golf, but I wanted to try to learn it. I got a random number generator from Wikipedia and decided to modify it so that it ended. Here's what I have:

v>>>>.v>
      ?^
 12345@
 ^ ^  
> ? ?^
 v?v  
v6789>

And I was wondering why it has a tendency to generate the number 2 a lot, usually repeated. Is it just the interpreter?

Quuxplusone
  • 23,928
  • 8
  • 94
  • 159
user1576628
  • 792
  • 3
  • 8
  • 25

1 Answers1

2

You are missing a question mark on line 4, underneath "2".
Your code starts by going to line 5 and then hit the question mark there. If the question mark goes "up" in your sample, it will allways hit "2", so that will happen 25% of the time.
If you add the missing question mark underneath the number 2 you should start seeing more random results.

flytzen
  • 7,348
  • 5
  • 38
  • 54