Skip to content

Commit

Permalink
fix: change n to number in levels 106-109 (#1595)
Browse files Browse the repository at this point in the history
  • Loading branch information
evemartin authored Mar 13, 2024
1 parent 234b66d commit 1561bbe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
16 changes: 8 additions & 8 deletions game/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -2309,12 +2309,12 @@ def description_level106():
def hint_level106():
return (
"""To use a variable to store the number of grid squares the van has to move you can do something like the following:
<pre>n = 1
<pre>number = 1
while not my_van.at_destination():
print n
n += 1</pre>
Variables can be used in place of constants when calling functions. For example to repeat something n times you can do something like the following:
<pre>for count in range(n):</pre>"""
print number
number += 1</pre>
Variables can be used in place of constants when calling functions. For example to repeat something <strong>number</strong> times you can do something like the following:
<pre>for count in range(number):</pre>"""
+ PYTHON_HINT
)

Expand All @@ -2333,7 +2333,7 @@ def description_level107():

def hint_level107():
return (
"To double the value of a variable you can do something like the following:<br><pre>n *= 2</pre>"
"To double the value of a variable you can do something like the following:<br><pre>number *= 2</pre>"
+ PYTHON_HINT
)

Expand All @@ -2350,7 +2350,7 @@ def description_level108():
def hint_level108():
return (
"To decrease the value of a variable by an amount you can do something like the "
"following:<br><pre>n -= 5</pre>" + PYTHON_HINT
"following:<br><pre>number -= 5</pre>" + PYTHON_HINT
)


Expand All @@ -2368,7 +2368,7 @@ def description_level109():

def hint_level109():
return (
"To halve the value of a variable you can do something like the following:<br><pre>n /= 2</pre>"
"To halve the value of a variable you can do something like the following:<br><pre>number /= 2</pre>"
+ PYTHON_HINT
)

Expand Down
28 changes: 14 additions & 14 deletions game/views/level_solutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,55 +241,55 @@ def big():
my_van = Van()
n = 1
number = 1
while not my_van.at_destination():
my_van.turn_right()
for count in range(n):
for count in range(number):
my_van.move_forwards()
n = n + 1"""
number = number + 1"""

lvl_107 = """from van import Van
my_van = Van()
n = 1
number = 1
while not my_van.at_destination():
my_van.turn_left()
for count in range(n):
for count in range(number):
my_van.move_forwards()
n = n * 2"""
number = number * 2"""

lvl_108 = """from van import Van
my_van = Van()
n = 6
number = 6
while not my_van.at_destination():
for i in range(n):
for i in range(number):
my_van.move_forwards()
my_van.turn_left()
n = n - 2"""
number = number - 2"""

lvl_109 = """from van import Van
my_van = Van()
n = 0
number = 0
for count in range(4):
my_van.turn_right()
for forward in range(n):
for forward in range(number):
my_van.move_forwards()
n = n + 1
number = number + 1
my_van.turn_right()
while not my_van.at_destination():
for count in range(n):
for count in range(number):
my_van.move_forwards()
my_van.turn_left()
n = n / 2"""
number = number / 2"""

lvl_113 = """from van import Van
Expand Down

0 comments on commit 1561bbe

Please sign in to comment.