Skip to content

Commit

Permalink
Merge pull request #38 from ab-apps/RemovingProblemSpec
Browse files Browse the repository at this point in the history
Removing problem_spec from all files
  • Loading branch information
varshav0119 authored Dec 18, 2021
2 parents 5a2c5cd + 29ed1ac commit c051eb4
Show file tree
Hide file tree
Showing 19 changed files with 3 additions and 23 deletions.
1 change: 0 additions & 1 deletion resources/problem-grids/L0_P0.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "state_match",
"problem_spec": "Level 0: Problem 0",
"statement": "Navigate the bot through a maze of obstacles and reach home."
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L0_P1.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "state_match",
"problem_spec": "Level 0: Problem 1",
"statement": "Navigate the bot through a maze of obstacles and reach home."
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L0_P2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "state_match",
"problem_spec": "Level 0: Problem 3",
"statement": "Take the shortest route home."
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L0_P3.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "state_match",
"problem_spec": "Level 0: Problem 2",
"statement": "Colour all the boxes with houses in the grid."
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L1_P1.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "value_match",
"problem_spec": "Level 1: Problem 1",
"statement": "Count the total number of coins in the grid."
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L1_P2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "value_match",
"problem_spec": "Level 1: Problem 2",
"statement": "On Monday, the robot takes the shorter path home, and counts the number of coins along the way as C1. On Tuesday, the robot takes the longer path home, and counts the number of coins as C2. What is the difference between C1 and C2?"
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L1_P3.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "value_match",
"problem_spec": "Level 1: Problem 3",
"statement": "AryaBota wants to equally share all the coins in this grid with a friend. How many coins does each one get?"
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L2_P1.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "value_match",
"problem_spec": "Level 2: Problem 1",
"statement": "Are there exactly 5 coins in this grid?"
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L2_P2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "value_match",
"problem_spec": "Level 2: Problem 2",
"statement": "Are there at least 10 coins in this grid?"
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L2_P3.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "value_match",
"problem_spec": "Level 2: Problem 3",
"statement": "Are there less than 30 coins in this grid?"
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L3_P1.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "state_match",
"problem_spec": "Level 3: Problem 1",
"statement": "Loop to colour the boundary of the grid."
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L3_P2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "state_match",
"problem_spec": "Level 3: Problem 2",
"statement": "Colour alternate boxes in the row."
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L3_P3.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "state_match",
"problem_spec": "Level 3: Problem 3",
"statement": "Colour the boxes where there are coin bags."
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L4_P1.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "state_match",
"problem_spec": "Level 2: Problem 1",
"statement": "Loop to colour the boundary of the grid."
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L4_P2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "state_match",
"problem_spec": "Level 4: Problem 2",
"statement": "Loop through the grid to get home."
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L4_P3.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "state_match",
"problem_spec": "Level 4: Problem 3",
"statement": "Loop to colour alternate boxes in the row."
},
"initial_state": {
Expand Down
1 change: 0 additions & 1 deletion resources/problem-grids/L4_P4.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"problem": {
"problem_type": "value_match",
"problem_spec": "Level 3: Problem 2",
"statement": "Loop to count the total number of coins in the grid"
},
"initial_state": {
Expand Down
6 changes: 2 additions & 4 deletions services/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def __init__(self):
self.rows = 1
self.columns = 1
self.homes = self.coins = self.coloured = self.coins_per_position = self.obstacles = self.obstacles_per_position = []
self.statement = self.problem_spec = ""
self.statement = ""

def configure(self, rows, columns, coins = None, coins_per_position = None, obstacles = None, obstacles_per_position = None, homes = None, statement = None, problem_spec = None, problem_type = None, answer = None):
def configure(self, rows, columns, coins = None, coins_per_position = None, obstacles = None, obstacles_per_position = None, homes = None, statement = None, problem_type = None, answer = None):
"""Configure attributes"""
self.rows = rows
self.columns = columns
Expand All @@ -33,7 +33,6 @@ def configure(self, rows, columns, coins = None, coins_per_position = None, obst
self.coins = self.coins_per_position = self.obstacles = self.obstacles_per_position = zero_coins
self.coloured = []
self.statement = statement
self.problem_spec = problem_spec
self.answer = answer
self.problem_type = problem_type
if coins is not None:
Expand Down Expand Up @@ -79,7 +78,6 @@ def get_state(self):
"obstacles_per_position": self.obstacles_per_position,
"homes": self.homes,
"statement": self.statement,
"problem_spec": self.problem_spec,
"coloured": self.coloured
}
return {}
Expand Down
3 changes: 1 addition & 2 deletions services/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def setup_grid_and_bot(problem):
problem_details = problem["problem"]
problem_type = problem_details["problem_type"]
statement = problem_details["statement"]
problem_spec = problem_details["problem_spec"]
state = problem["initial_state"]
bot = CoinSweeper.get_instance()
coin_sweeper_state = state["coin_sweeper"]
Expand All @@ -49,7 +48,7 @@ def setup_grid_and_bot(problem):
grid_state["obstacles"] = None
if not "homes" in grid_state:
grid_state["homes"] = None
grid.configure(rows, columns, grid_state["coins"], coins_per_position, grid_state["obstacles"], obstacles_per_position, grid_state["homes"], statement, problem_spec, problem_type, answer)
grid.configure(rows, columns, grid_state["coins"], coins_per_position, grid_state["obstacles"], obstacles_per_position, grid_state["homes"], statement, problem_type, answer)

def initialise(problem_file_path):
"""Initialises chosen problem"""
Expand Down

0 comments on commit c051eb4

Please sign in to comment.