Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
472 B
2
Indexable
Never
from functools import lru_cache

def moves(h):
    return h + 1, h + 2, h + 3

def f(n):
    if h>=50:
        return 'END'
    elif any(f(n)=='END' for x in moves(h)):
        return 'П1'
    elif all(f(n)=='П1' for x in moves(h)):
            return 'В1'    
    elif any(f(n)=='В1' for x in moves(h)):
        return 'П2'        
    elif all(f(n)=='П2' for x in moves(h)):
            return 'В2'    

for i in range(1, 50):
    print(i, f(i))