Skip to content

Commit d291e0a

Browse files
Chipe1norvig
authored andcommitted
Added TicTacToe to notebook (aimacode#213)
* Error message of python errors * Added Canvas_TicTacToe class * Added TicTacToe to notebook * Added games.ipynb * moved js file to js folder
1 parent 8b08880 commit d291e0a

File tree

4 files changed

+129
-463
lines changed

4 files changed

+129
-463
lines changed

canvas.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from IPython.display import HTML, display, clear_output
22

33
_canvas = """
4-
<script type="text/javascript" src="./canvas.js"></script>
4+
<script type="text/javascript" src="./js/canvas.js"></script>
55
<div>
66
<canvas id="{0}" width="{1}" height="{2}" style="background:rgba(158, 167, 184, 0.2);" onclick='click_callback(this, event, "{3}")'></canvas>
77
</div>
@@ -109,7 +109,7 @@ def text_n(self, txt, xn, yn, fill = True):
109109
"Similar to text(), but with normalized coordinates"
110110
x = round(xn * self.width)
111111
y = round(yn * self.height)
112-
self.text(text, x, y, fill)
112+
self.text(txt, x, y, fill)
113113

114114
def alert(self, message):
115115
"Immediately display an alert"

0 commit comments

Comments
 (0)