Last active
April 29, 2020 03:27
-
-
Save peacock0803sz/ec695ccba42945db3e04ad92cc152aad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import choice | |
from typing import Generator | |
ZUN = "ズン" | |
DOKO = "ドコ" | |
KIYOSHI = "キ・ヨ・シ!" | |
def generate_stream() -> Generator[str, None, None]: | |
while True: | |
print(which := choice([ZUN, DOKO]), end="") | |
yield which | |
def main(): | |
stream = [] | |
while not (stream[-6:] == [DOKO] + [ZUN] * 4 + [DOKO]): | |
stream.append(next(generate_stream())) | |
print(KIYOSHI) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment