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
| def read_chunk(dst, src, chunk_size, pos, len_src): | |
| while chunk_size > 0 and pos < len_src: | |
| dst.append(src[pos]) | |
| pos += 1 | |
| chunk_size -= 1 | |
| return pos | |
| def get_bingo_size(pos, chunk_size, len_src): | |
| if pos + chunk_size > len_src: | |
| return len_src - pos |
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
| class State: | |
| state_handlers = { | |
| 's_open': ('h_open', 'h_num'), | |
| 's_close': ('h_close', 'h_op'), | |
| 's_num': ('h_num'), | |
| 's_op': ('h_op') | |
| } | |
| state_map = { | |
| 'h_open': 's_open', |
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 randint | |
| import pygame | |
| from pygame.locals import * | |
| import time | |
| W = 10 | |
| PLAYER = 20 | |
| ROBOT = 30 | |
| DEAD_ROBOT = 35 | |
| HAZARD = 40 |
NewerOlder