Skip to content

Commit

Permalink
changed coin_sweeper to arya_bota
Browse files Browse the repository at this point in the history
  • Loading branch information
afreenanooraniaan1 committed Dec 18, 2021
1 parent c051eb4 commit 95479d3
Show file tree
Hide file tree
Showing 25 changed files with 71 additions and 71 deletions.
8 changes: 4 additions & 4 deletions control_hub.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
"""Control Hub that makes changes to the CoinSweeper environment - grid and robot"""
"""Control Hub that makes changes to the AryaBota environment - grid and robot"""
# Writes outcomes to a result file
import json
import yaml

from services.grid import Grid
from services.coin_sweeper import CoinSweeper
from services.arya_bota import AryaBota
from services.utils import check_answer

# Opening config to read grid attributes
with open('config.yaml') as f:
config = yaml.load(f, Loader=yaml.FullLoader)

BOT = CoinSweeper.get_instance()
BOT = AryaBota.get_instance()
GRID = Grid.get_instance()
results_file_path = config["app"]["results"]

Expand Down Expand Up @@ -247,7 +247,7 @@ def submit(value = None):
response = check_answer(value)
else:
current_state = {
"coin_sweeper": BOT.get_state_for_answer(),
"arya_bota": BOT.get_state_for_answer(),
"grid": GRID.get_state_for_answer()
}
response = check_answer(current_state)
Expand Down
4 changes: 2 additions & 2 deletions languages/english.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from services.utils import convert_english_pseudocode_to_python
from control_hub import *
from services.grid import Grid
from services.coin_sweeper import CoinSweeper
from services.arya_bota import AryaBota

bot = CoinSweeper.get_instance()
bot = AryaBota.get_instance()
grid = Grid.get_instance()

class LexerError(Exception): pass
Expand Down
4 changes: 2 additions & 2 deletions lexer_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from control_hub import *
from services.grid import Grid
from services.coin_sweeper import CoinSweeper
from services.arya_bota import AryaBota
from services.utils import get_custom_error
from languages.english import english_lexer, english_parser

Expand Down Expand Up @@ -48,7 +48,7 @@ def make_command(command, value = None):
]
}

bot = CoinSweeper.get_instance()
bot = AryaBota.get_instance()
grid = Grid.get_instance()

def understand(commands):
Expand Down
12 changes: 6 additions & 6 deletions problem.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Importing Grid Module"""
from grid import Grid
from coin_sweeper import CoinSweeper
from arya_bota import AryaBota

class DictCompareWrapper:
"""Comparing dictionaries"""
Expand Down Expand Up @@ -133,12 +133,12 @@ def check_answer(self, submitted_answer):
def get_initial_state(self):
"""Return intial state of problem"""
grid = Grid.get_instance()
bot = CoinSweeper.get_instance()
bot = AryaBota.get_instance()
grid_state = grid.get_state()
coin_sweeper_state = bot.get_state()
grid_state.update(coin_sweeper_state)
arya_bota_state = bot.get_state()
grid_state.update(arya_bota_state)
grid_state["type"] = self.type
if self.type == "state_match":
if "coin_sweeper" in self.answer["state"]:
grid_state["homes"] = [self.answer["state"]["coin_sweeper"]]
if "arya_bota" in self.answer["state"]:
grid_state["homes"] = [self.answer["state"]["arya_bota"]]
return grid_state
4 changes: 2 additions & 2 deletions resources/problem-grids/L0_P0.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
]
},
"coin_sweeper": {
"arya_bota": {
"pen": "down",
"position": {
"row": 1,
Expand All @@ -45,7 +45,7 @@
"type": "strict",
"state": {
"grid": {},
"coin_sweeper": {
"arya_bota": {
"position": {
"row": 3,
"column": 3
Expand Down
4 changes: 2 additions & 2 deletions resources/problem-grids/L0_P1.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
}
]
},
"coin_sweeper": {
"arya_bota": {
"pen": "down",
"position": {
"row": 1,
Expand All @@ -117,7 +117,7 @@
"type": "strict",
"state": {
"grid": {},
"coin_sweeper": {
"arya_bota": {
"position": {
"row": 7,
"column": 7
Expand Down
4 changes: 2 additions & 2 deletions resources/problem-grids/L0_P2.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
}
]
},
"coin_sweeper": {
"arya_bota": {
"pen": "down",
"position": {
"row": 1,
Expand All @@ -146,7 +146,7 @@
"answer": {
"type": "strict",
"state": {
"coin_sweeper": {
"arya_bota": {
"position": {
"row": 6,
"column": 8
Expand Down
4 changes: 2 additions & 2 deletions resources/problem-grids/L0_P3.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
}
]
},
"coin_sweeper": {
"arya_bota": {
"pen": "down",
"position": {
"row": 1,
Expand All @@ -80,7 +80,7 @@
"answer": {
"type": "lenient",
"state": {
"coin_sweeper": {
"arya_bota": {
},
"grid": {
"coloured": [
Expand Down
2 changes: 1 addition & 1 deletion resources/problem-grids/L1_P1.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
]
},
"coin_sweeper": {
"arya_bota": {
"position": {
"row": 1,
"column": 1
Expand Down
2 changes: 1 addition & 1 deletion resources/problem-grids/L1_P2.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
}
]
},
"coin_sweeper": {
"arya_bota": {
"position": {
"row": 1,
"column": 1
Expand Down
2 changes: 1 addition & 1 deletion resources/problem-grids/L1_P3.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"number": 4
}]
},
"coin_sweeper": {
"arya_bota": {
"pen": "up",
"position": {
"row": 1,
Expand Down
2 changes: 1 addition & 1 deletion resources/problem-grids/L2_P1.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
]
},
"coin_sweeper": {
"arya_bota": {
"position": {
"row": 1,
"column": 1
Expand Down
2 changes: 1 addition & 1 deletion resources/problem-grids/L2_P2.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
}
]
},
"coin_sweeper": {
"arya_bota": {
"position": {
"row": 1,
"column": 1
Expand Down
2 changes: 1 addition & 1 deletion resources/problem-grids/L2_P3.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
]
},
"coin_sweeper": {
"arya_bota": {
"position": {
"row": 1,
"column": 1
Expand Down
4 changes: 2 additions & 2 deletions resources/problem-grids/L3_P1.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"column": 4
}
},
"coin_sweeper": {
"arya_bota": {
"pen": "down",
"position": {
"row": 1,
Expand All @@ -22,7 +22,7 @@
"answer": {
"type": "strict",
"state": {
"coin_sweeper": {
"arya_bota": {
},
"grid": {
"coloured": [
Expand Down
4 changes: 2 additions & 2 deletions resources/problem-grids/L3_P2.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"column": 8
}
},
"coin_sweeper": {
"arya_bota": {
"pen": "up",
"position": {
"row": 1,
Expand All @@ -22,7 +22,7 @@
"answer": {
"type": "strict",
"state": {
"coin_sweeper": {
"arya_bota": {
},
"grid": {
"coloured": [
Expand Down
4 changes: 2 additions & 2 deletions resources/problem-grids/L3_P3.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"number": 5
}]
},
"coin_sweeper": {
"arya_bota": {
"pen": "up",
"position": {
"row": 1,
Expand All @@ -51,7 +51,7 @@
"answer": {
"type": "strict",
"state": {
"coin_sweeper": {
"arya_bota": {
},
"grid": {
"coloured": [
Expand Down
4 changes: 2 additions & 2 deletions resources/problem-grids/L4_P1.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"column": 4
}
},
"coin_sweeper": {
"arya_bota": {
"pen": "up",
"position": {
"row": 1,
Expand All @@ -22,7 +22,7 @@
"answer": {
"type": "strict",
"state": {
"coin_sweeper": {
"arya_bota": {
},
"grid": {
"coloured": [
Expand Down
4 changes: 2 additions & 2 deletions resources/problem-grids/L4_P2.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
}
]
},
"coin_sweeper": {
"arya_bota": {
"pen": "up",
"position": {
"row": 1,
Expand All @@ -122,7 +122,7 @@
"answer": {
"type": "strict",
"state": {
"coin_sweeper": {
"arya_bota": {
"position": {
"row": 9,
"column": 1
Expand Down
4 changes: 2 additions & 2 deletions resources/problem-grids/L4_P3.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"column": 8
}
},
"coin_sweeper": {
"arya_bota": {
"pen": "up",
"position": {
"row": 1,
Expand All @@ -22,7 +22,7 @@
"answer": {
"type": "strict",
"state": {
"coin_sweeper": {
"arya_bota": {
},
"grid": {
"coloured": [
Expand Down
2 changes: 1 addition & 1 deletion resources/problem-grids/L4_P4.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
]
},
"coin_sweeper": {
"arya_bota": {
"pen": "down",
"position": {
"row": 1,
Expand Down
2 changes: 1 addition & 1 deletion resources/schema/problem_state.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
}
}
},
"coin_sweeper": {
"arya_bota": {
"type": "object",
"properties": {
"position": {
Expand Down
Loading

0 comments on commit 95479d3

Please sign in to comment.