Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def swiat(n,m,k,TablicaSwiatel):
- a=[0]*n
- a[0]=+m
- licznik =05
- k=0
- TablicaSwiatel=[0]*n
- while a[n-1] is not m: #is not m
- licznik=+1
- """
- while k is not 3:
- """
- for j in range(len(b)):
- if b[j] is 1:
- b[j]=0
- else:
- b[j]=1
- for i in range(len(a)-1):
- if a[i] is not 0:
- if b[i+1] is 0:
- a[i+1]+=1
- a[i]-=1
- print('while')
- print('exit')
- return a,b
- n = input('Prosze podac wielkosc swiata')
- m = input('Prosze podac ilosc foobarian')
- k = input('Prosze podac ilosc swiatel ktore maja znajdowac sie w swiecie')
- for i in range(k):
- pozycja = input('Pozycja na ktorej ma znajdowac sie swiatlo')
- kolor = raw_input('Kolor swiatla 0=zielone 1=czerwone')
- TablicaSwiatel[pozycja] = kolor
- print swiat(n,m,w,TablicaSwiatel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement