mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-11 07:00:41 -04:00
chore(curriculum): remove pyodide from tower of hanoi puzzle project (#54760)
This commit is contained in:
@@ -24,7 +24,7 @@ You should have a variable named `rods`.
|
||||
Your `rods` variable should be an empty dictionary.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`
|
||||
({ test: () => assert(runPython(`
|
||||
rods = __locals.get("rods")
|
||||
rods == {}
|
||||
`))
|
||||
|
||||
@@ -18,7 +18,7 @@ The syntax is `range(x, y, h)`, where `x` is the starting integer (inclusive), `
|
||||
You should use the `range()` function to assign a sequence of numbers to `rods['A']`. The syntax for calling the `range()` function is `range(x, y, h)`.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`
|
||||
({ test: () => assert(runPython(`
|
||||
a = __locals.get('rods')
|
||||
type(a['A']) is range
|
||||
`))
|
||||
@@ -28,7 +28,7 @@ You should use the `range()` function to assign a sequence of numbers to `rods['
|
||||
You should use the `range()` function to assign the sequence of numbers from `3` to `1` to `rods['A']`.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`
|
||||
({ test: () => assert(runPython(`
|
||||
a = __locals.get('rods')
|
||||
a['A'] == range(3, 0, -1)
|
||||
`))
|
||||
|
||||
@@ -16,7 +16,7 @@ Pass your `range()` call to the `list()` function to do that.
|
||||
You should pass your `range()` call to the `list()` function.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`
|
||||
({ test: () => assert(runPython(`
|
||||
a = __locals.get('rods')
|
||||
a['A'] == list(range(3, 0, -1))
|
||||
`))
|
||||
|
||||
@@ -21,7 +21,7 @@ You should declare an empty function named `move`. Remember to use the `pass` ke
|
||||
|
||||
```js
|
||||
({ test: () => {
|
||||
assert(__pyodide.runPython(`
|
||||
assert(runPython(`
|
||||
import inspect
|
||||
inspect.isfunction(__locals.get('move'))
|
||||
`))
|
||||
|
||||
@@ -23,7 +23,7 @@ The value of `number_of_moves` should be the expression to calculate the number
|
||||
|
||||
```js
|
||||
({ test: () => {
|
||||
assert(__pyodide.runPython(`
|
||||
assert(runPython(`
|
||||
a = __locals.get('NUMBER_OF_DISKS')
|
||||
__locals.get('number_of_moves') == 2**a -1
|
||||
`))
|
||||
|
||||
@@ -39,7 +39,7 @@ ${tCode.slice(ifLoc + ifLen)}
|
||||
|
||||
__counter
|
||||
`;
|
||||
const out = __pyodide.runPython(newCode);
|
||||
const out = runPython(newCode);
|
||||
assert.equal(out, 3);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -15,7 +15,7 @@ Instead of repeating the same code you wrote during the previous few steps and c
|
||||
You should declare an empty function named `make_allowed_move`. Remember to use the `pass` keyword inside the function body with the correct indentation.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`
|
||||
({ test: () => assert(runPython(`
|
||||
import inspect
|
||||
inspect.isfunction(__locals.get('make_allowed_move'))
|
||||
`))
|
||||
|
||||
@@ -14,7 +14,7 @@ Add two parameters called `rod1` and `rod2` to your new function.
|
||||
Your `make_allowed_move()` function should have two parameters named `rod1` and `rod2`.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`
|
||||
({ test: () => assert(runPython(`
|
||||
import inspect
|
||||
str(inspect.signature(__locals.get('make_allowed_move'))) == '(rod1, rod2)'
|
||||
`))
|
||||
|
||||
@@ -14,14 +14,14 @@ The `rods` dictionary will represent the three rods with their disks. Give it th
|
||||
Your `rods` dictionary should have an `'A'` key.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`'A' in __locals.get("rods")`)) })
|
||||
({ test: () => assert(runPython(`'A' in __locals.get("rods")`)) })
|
||||
|
||||
```
|
||||
|
||||
`rods['A']` should be an empty list.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`
|
||||
({ test: () => assert(runPython(`
|
||||
a = __locals.get("rods")
|
||||
a['A'] == []
|
||||
`))
|
||||
@@ -31,14 +31,14 @@ Your `rods` dictionary should have an `'A'` key.
|
||||
Your `rods` dictionary should have a `'B'` key.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`'B' in __locals.get("rods")`)) })
|
||||
({ test: () => assert(runPython(`'B' in __locals.get("rods")`)) })
|
||||
|
||||
```
|
||||
|
||||
`rods['B']` should be an empty list.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`
|
||||
({ test: () => assert(runPython(`
|
||||
a = __locals.get("rods")
|
||||
a['B'] == []
|
||||
`))
|
||||
@@ -48,14 +48,14 @@ Your `rods` dictionary should have a `'B'` key.
|
||||
Your `rods` dictionary should have a `'C'` key.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`'C' in __locals.get("rods")`)) })
|
||||
({ test: () => assert(runPython(`'C' in __locals.get("rods")`)) })
|
||||
|
||||
```
|
||||
|
||||
`rods['C']` should be an empty list.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`
|
||||
({ test: () => assert(runPython(`
|
||||
a = __locals.get("rods")
|
||||
a['C'] == []
|
||||
`))
|
||||
|
||||
@@ -20,7 +20,7 @@ Currently, the `move()` function does not take any parameters. Change the functi
|
||||
Your `move()` function should have `n`, `source`, `auxiliary`, and `target` as the parameters. The order matters.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`
|
||||
({ test: () => assert(runPython(`
|
||||
import inspect
|
||||
str(inspect.signature(__locals.get('move'))) == '(n, source, auxiliary, target)'
|
||||
`))
|
||||
|
||||
@@ -16,7 +16,7 @@ Well done. You have completed the Tower of Hanoi practice project.
|
||||
You should reduce the indentation level of all the code after the `return` statement.
|
||||
|
||||
```js
|
||||
({ test: () => assert(__pyodide.runPython(`
|
||||
({ test: () => assert(runPython(`
|
||||
hanoi = __locals.get("move")
|
||||
a, b, c = [3, 2, 1], [], []
|
||||
hanoi(3, a, b, c)
|
||||
|
||||
Reference in New Issue
Block a user