-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathglad_mickey.py
More file actions
71 lines (57 loc) · 2.08 KB
/
glad_mickey.py
File metadata and controls
71 lines (57 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from arena_fbf import *
"""
A gladiator's "turn" for FBF should be as follows
1. Check current room for needed conditions
2. FizzBuzz the room's int and submit number of Fizzes, Buzzes, and FizzBuzzes in order
3. If submission is correct, collect Macguffin
4. Move to new room
5. Repeat until all needed Macguffins are collected
"""
GLAD1 = "Mickey two-clicks"
import random
def fizzbuzz(number):
fizz = 0
buzz = 0
fizzbuzz = 0
for i in range(number):
if i % 3 == 0 & i % 5 == 0:
fizzbuzz += 1
elif i % 3 == 0:
fizz += 1
elif i % 5 == 0:
buzz += 0
answer = [fizz, buzz, fizzbuzz]
return answer
class Gladiator:
def __init__(self, name, arena):
# gladiator name
self.name = name
# arena size and info
self.arena = arena
self.row = random.randint(0, len(arena) - 1)
self.col = random.randint(0, len(arena[0]) - 1)
self.collected = set()
def fizzbuzz(int):
pass
def move(self, direction):
# moves based on u,d,l,r or cardinal directions
if direction == "u" or "up" or "n" or "north" and self.row > 0:
self.row -= 1
elif direction == "d" or "down" or "s" or "south" and self.row < len(self.arena) - 1:
self.row += 1
elif direction == "l" or "left" or "w" or "west" and self.col > 0:
self.col -= 1
elif direction == "r" or "right" or "e" or "east" and self.col < len(self.arena) -1:
self.col += 1
def check_room(self):
# returns arena location to gladiator
return self.arena[self.row][self.col]
def solve_room(self):
room = self.check_room()
# review room for conditions
print(f"{self.name} is in a room with {room['macguffin']} with int {room['number']}.")
# if condition met, do action
# SPECIFICALLY CHECK SYNTAX BELOW FOR ACCURACY
if room['macguffin'] not in self.collected:
answer = fizzbuzz(room['number'])
self.collected.append(self.submit(answer))