Skip to content

Instantly share code, notes, and snippets.

@nuryslyrt
Created November 25, 2011 17:00
Show Gist options
  • Save nuryslyrt/1393977 to your computer and use it in GitHub Desktop.
Save nuryslyrt/1393977 to your computer and use it in GitHub Desktop.
Random sayılar üretmesi içindi.
#!/usr/bin/python
#-*- coding: utf-8 -*-
import random
import math
def printRandomNumbers(y):
status = range(1, y)
while len(status) == y:
i = 0
sayac = 0
for i < y in status:
i += 1
status[i] = 'f'
sayac = limit
i = 0
for i < y in status:
x = random(sayac)
k = 0
j = 0
for j < y in status:
j += 1
if status[j] == 'f':
k += 1
if k == x:
break
print j
status[j] = 't'
sayac = sayac-1
return printRandomNumbers(y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment