Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

###How?

How?

###How?

How?

added 44 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293

Jelly, (削除) 42 38 34 33 29 (削除ここまで) 2932 bytes

+3 to adhere to strict formatting rules

5ȷɓ;8Ä:2,×ばつ"=%»ḟ0Fȯb@ð€×ばつ"=%»ḟ0Fȯb@K\ð€Y

A monadic Linkfull program which yields a listprints 5000 lines of liststext, each being either oneline containing a series of the listsintegers (the digits) or one of characters 'fizz'fizz, 'buzz'buzz, or 'fizzbuzz' or a list of the (integer) digits in the given basefizzbuzz (so worksworks fine beyond base 62).

Try it online! Try it online!

Note that
\$\lfloor b÷2+1\rfloor\ = \lfloor b÷2\rfloor+1\$
...and
\$\lceil b÷3+3\rceil = \lceil b÷3+2\rceil+1 = \lceil (b+6)÷3\rceil+1 = \lfloor (b+8)÷3\rfloor+1\$

updating...

Jelly, (削除) 42 38 34 33 (削除ここまで) 29 bytes

5ȷɓ;8Ä:2,×ばつ"=%»ḟ0Fȯb@ð€

A monadic Link which yields a list of lists, each being either one of the lists of characters 'fizz', 'buzz', or 'fizzbuzz' or a list of the (integer) digits in the given base (so works fine beyond 62).

Try it online!

Note that
\$\lfloor b÷2+1\rfloor\ = \lfloor b÷2\rfloor+1\$
...and
\$\lceil b÷3+3\rceil = \lceil b÷3+2\rceil+1 = \lceil (b+6)÷3\rceil+1 = \lfloor (b+8)÷3\rfloor+1\$

Jelly, (削除) 42 38 34 33 29 (削除ここまで) 32 bytes

+3 to adhere to strict formatting rules

5ȷɓ;8Ä:2,×ばつ"=%»ḟ0Fȯb@K\ð€Y

A full program which prints 5000 lines of text, each line containing a series of integers (the digits) or one of fizz, buzz, or fizzbuzz (works fine beyond base 62).

Try it online!

Note that
\$\lfloor b÷2+1\rfloor\ = \lfloor b÷2\rfloor+1\$
...and
\$\lceil b÷3+3\rceil = \lceil b÷3+2\rceil+1 = \lceil (b+6)÷3\rceil+1 = \lfloor (b+8)÷3\rfloor+1\$

updating...

added 10 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
×ばつ"=%»ḟ0Fȯb@ð€ - Link: integer, b
5ȷ - 5*103 = 5000
 ɓ ð€ - for €ach n in [1,2,...,5000] get this f(b,n):
 8 - eight
 ; - concatenate -> [b,8]
 Ä - cumulative sums -> [b,b+8]
 2,3 - pair literal [2,3]
 : - integer division -> [b//2, (b+8)//3]
 ‘ - increment -> [b//2+1, (b+8)//3+1]
 ḍ - divides n? -> [fizzy[n is fizzy?, n is buzzy?]
 ×ばつ"=%» - list of dictionary strings = ['fizz','buzz']
 " - zip with:
 ȧ - logical AND -> [0,0], ['fizz',0], [0,'buzz'],
 - or ['fizz','buzz']
 0 - zero
 ḟ - filter discard -> [], ['fizz'], ['buzz'],
 - or ['fizz','buzz']
 F - flatten -> [], ['fizz'], ['buzz'],
 - or ['fizzbuzz']
 @ - using swapped arguments:
 b - (n) to a list of digits in base (b) (say, [nb])
 ȯ - logical OR -> [nb], ['fizz'], ['buzz'],
 - or ['fizzbuzz']
×ばつ"=%»ḟ0Fȯb@ð€ - Link: integer, b
5ȷ - 5*103 = 5000
 ɓ ð€ - for €ach n in [1,2,...,5000] get this f(b,n):
 8 - eight
 ; - concatenate -> [b,8]
 Ä - cumulative sums -> [b,b+8]
 2,3 - pair literal [2,3]
 : - integer division -> [b//2, (b+8)//3]
 ‘ - increment -> [b//2+1, (b+8)//3+1]
 ḍ - divides n? -> [fizzy?, buzzy?]
 ×ばつ"=%» - list of dictionary strings = ['fizz','buzz']
 " - zip with:
 ȧ - logical AND -> [0,0], ['fizz',0], [0,'buzz'],
 - or ['fizz','buzz']
 0 - zero
 ḟ - filter discard -> [], ['fizz'], ['buzz'],
 - or ['fizz','buzz']
 F - flatten -> [], ['fizz'], ['buzz'],
 - or ['fizzbuzz']
 @ - using swapped arguments:
 b - (n) to a list of digits in base (b) (say, [nb])
 ȯ - logical OR -> [nb], ['fizz'], ['buzz'],
 - or ['fizzbuzz']
×ばつ"=%»ḟ0Fȯb@ð€ - Link: integer, b
5ȷ - 5*103 = 5000
 ɓ ð€ - for €ach n in [1,2,...,5000] get this f(b,n):
 8 - eight
 ; - concatenate -> [b,8]
 Ä - cumulative sums -> [b,b+8]
 2,3 - pair literal [2,3]
 : - integer division -> [b//2, (b+8)//3]
 ‘ - increment -> [b//2+1, (b+8)//3+1]
 ḍ - divides n? -> [n is fizzy?, n is buzzy?]
 ×ばつ"=%» - list of dictionary strings = ['fizz','buzz']
 " - zip with:
 ȧ - logical AND -> [0,0], ['fizz',0], [0,'buzz'],
 - or ['fizz','buzz']
 0 - zero
 ḟ - filter discard -> [], ['fizz'], ['buzz'],
 - or ['fizz','buzz']
 F - flatten -> [], ['fizz'], ['buzz'],
 - or ['fizzbuzz']
 @ - using swapped arguments:
 b - (n) to a list of digits in base (b) (say, [nb])
 ȯ - logical OR -> [nb], ['fizz'], ['buzz'],
 - or ['fizzbuzz']
added 87 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading
edited body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading
added 1534 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading
deleted 122 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading
deleted 11 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading
added 2 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading
added 176 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading
added 176 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading
added 176 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading

AltStyle によって変換されたページ (->オリジナル) /