Skip to main content
added 709 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63

Python 2, 117 113 108 107 106 105 bytes

from random import*
def f(n):a=['']*5;exec"i=randint(0,(n>44)+(n>59)<<1);a[i]=(a[i]or 0)+1;"*1000;print a

Try it online!

Returns a reversed list (bottom first)


Version inspired by the stackoverflow answer in the comments (edgecases are more likely):

Python 2, 129 bytes

from random import*
def f(n):a=sorted([1000]*5+sample(range(1001)*5,(n>44)+(n>59)<<1));print[y-x or''for x,y in zip([0]+a,a)[:5]]

Try it online!

Python 2, 117 113 108 107 106 105 bytes

from random import*
def f(n):a=['']*5;exec"i=randint(0,(n>44)+(n>59)<<1);a[i]=(a[i]or 0)+1;"*1000;print a

Try it online!

Returns a reversed list (bottom first)

Python 2, 117 113 108 107 106 105 bytes

from random import*
def f(n):a=['']*5;exec"i=randint(0,(n>44)+(n>59)<<1);a[i]=(a[i]or 0)+1;"*1000;print a

Try it online!

Returns a reversed list (bottom first)


Version inspired by the stackoverflow answer in the comments (edgecases are more likely):

Python 2, 129 bytes

from random import*
def f(n):a=sorted([1000]*5+sample(range(1001)*5,(n>44)+(n>59)<<1));print[y-x or''for x,y in zip([0]+a,a)[:5]]

Try it online!

added 7 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63

Python 2, 117 113 108 107 106106 105 bytes

from random import*
def f(n):a=[0]*5;exec"a[randinta=['']*5;exec"i=randint(0,(n>44)+(n>59)<<1)]+=1;"*1000;print[v or''for v;a[i]=(a[i]or in0)+1;"*1000;print a]a

Try it online!Try it online!

Returns a reversed list (bottom first)

Python 2, 117 113 108 107 106 bytes

from random import*
def f(n):a=[0]*5;exec"a[randint(0,(n>44)+(n>59)<<1)]+=1;"*1000;print[v or''for v in a]

Try it online!

Returns a reversed list (bottom first)

Python 2, 117 113 108 107 106 105 bytes

from random import*
def f(n):a=['']*5;exec"i=randint(0,(n>44)+(n>59)<<1);a[i]=(a[i]or 0)+1;"*1000;print a

Try it online!

Returns a reversed list (bottom first)

added 9 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63

Python 2, 117 113 108 107107 106 bytes

from random import*
def f(n):a=[0]*5;exec"a[randint(0,2*((n>44)+(n>59))<<1)]+=1;"*1000;print[v or''for v in a]

Try it online!Try it online!

Returns a reversed list (bottom first)

Python 2, 117 113 108 107 bytes

from random import*
def f(n):a=[0]*5;exec"a[randint(0,2*((n>44)+(n>59)))]+=1;"*1000;print[v or''for v in a]

Try it online!

Returns a reversed list (bottom first)

Python 2, 117 113 108 107 106 bytes

from random import*
def f(n):a=[0]*5;exec"a[randint(0,(n>44)+(n>59)<<1)]+=1;"*1000;print[v or''for v in a]

Try it online!

Returns a reversed list (bottom first)

deleted 1 character in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63
Loading
added 19 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63
Loading
added 11 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63
Loading
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63
Loading