pip install ipythonIf you also wanna use the notebook:
| import os | |
| import time | |
| from random import randint | |
| os.system('cls' if os.name == 'nt' else 'clear') | |
| DOWN = "Down" | |
| RIGHT = "Right" | |
| DESTINATION = "Destination!" | |
| EMPTY_CHAR = "[ ]" | |
| OBSTACLE_CHAR = "[X]" |
| #Leo, I found a better way. Look where I moved the int() call to: | |
| r, c = [int(c) for c in user_input if c.isdigit()][:2] | |
| # r = int(r) | |
| # c = int(c) |
| """ | |
| backtrack2.py | |
| ------------- | |
| Converting backtrack to OOP: | |
| """ | |
| """ | |
| Notes: June 3 | |
| Obstacles seem to be being drawn in the wrong squares |
| import random | |
| def is_int(x): | |
| ''' | |
| Given a number, returns a boolean declaring if | |
| the number is an integer. | |
| ''' | |
| return x % 1 == 0 |
| def decode(compressed): | |
| ''' | |
| Given an Run Length Encoded (RLE) string, decodes it | |
| into its original format, and returns this decoded string. | |
| ''' | |
| groups = groupby(compressed, lambda x: x.isdigit()) | |
| output = '' | |
| count = 1 |
| def nest_while(f, value, condition): | |
| ''' | |
| Given function, initial value, and break condition, | |
| calls function with the initial value, and repeats calling | |
| the function with the return value of the previous call, | |
| until the condition returns false. | |
| ''' | |
| if not condition(value): | |
| return value | |
| return nest_while(f, f(value), condition) |
{ "name": "Migrating to Aurelia from Angular 1.x", "culture": "en-US", "description": "If you have an existing Angular application that you would like to migrate to Aurelia, you can use the conversion guides and implementation notes here to streamline the process.", "engines" : { "aurelia-doc" : "^1.0.0" }, "author": { "name": "Jedd Ahyoung", "url": "http://www.jedd-ahyoung.com" },