Skip to main content
Commonmark migration
Source Link

#Python, 70 chars

Python, 70 chars

def rand7():
 while True:
  n=5*(rand5()-1)+(rand5()-1)
  if n<21:return n%7+1

but completely correct based on the reasoning here.

#Python, 70 chars

def rand7():
 while True:
  n=5*(rand5()-1)+(rand5()-1)
  if n<21:return n%7+1

but completely correct based on the reasoning here.

Python, 70 chars

def rand7():
 while True:
  n=5*(rand5()-1)+(rand5()-1)
  if n<21:return n%7+1

but completely correct based on the reasoning here.

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

#Python, 70 chars

def rand7():
 while True:
  n=5*(rand5()-1)+(rand5()-1)
  if n<21:return n%7+1

but completely correct based on the reasoning herehere.

#Python, 70 chars

def rand7():
 while True:
  n=5*(rand5()-1)+(rand5()-1)
  if n<21:return n%7+1

but completely correct based on the reasoning here.

#Python, 70 chars

def rand7():
 while True:
  n=5*(rand5()-1)+(rand5()-1)
  if n<21:return n%7+1

but completely correct based on the reasoning here.

Source Link

#Python, 70 chars

def rand7():
 while True:
  n=5*(rand5()-1)+(rand5()-1)
  if n<21:return n%7+1

but completely correct based on the reasoning here.