This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ttt-repl (board) | |
"Read-Eval-Print-Loop for Tic-Tac-Toe" | |
(ttt-print board) | |
(ttt-repl (ttt-eval (ttt-read board)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(documentation 'ttt-repl 'function) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'(nil nil nil nil X nil nil nil O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ttt-print (board) | |
"Prints a tic-tac-toe board." | |
(let* ((nl (string #\Newline)) | |
(str (concatenate 'string | |
"S|S|S" nl | |
"-|-|-" nl | |
"S|S|S" nl | |
"-|-|-" nl | |
"S|S|S" nl))) | |
(format t str))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ttt-print (board) | |
"Prints a tic-tac-toe board." | |
(let* ((symbol nil) | |
(nl (string #\Newline)) | |
(str (concatenate 'string | |
"S|S|S" nl | |
"-|-|-" nl | |
"S|S|S" nl | |
"-|-|-" nl | |
"S|S|S" nl))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ttt-print (board) | |
"Pretty prints a given board." | |
(format t "~% 1 2 3 <- cols~%~%") | |
(format t "1 ~1<~@[~A~]~>|~1<~@[~A~]~>|~1<~@[~A~]~>~% -+-+-~%" | |
(pop board) (pop board) (pop board)) | |
(format t "2 ~1<~@[~A~]~>|~1<~@[~A~]~>|~1<~@[~A~]~>~% -+-+-~%" | |
(pop board) (pop board) (pop board)) | |
(format t "3 ~1<~@[~A~]~>|~1<~@[~A~]~>|~1<~@[~A~]~>~%" | |
(pop board) (pop board) (pop board)) | |
(format t "^~% \\_ rows~%")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(var i = 0; i < objects.length; i++) { | |
build_element(objects[i]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
import random | |
from sys import stdin | |
words = [] | |
for line in stdin: | |
words.append(line.strip()) | |
print(random.sample(words,12)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
import random | |
from sys import stdin, argv | |
words = [] | |
for line in stdin: | |
words.append(line.strip()) | |
n = int(argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Aerospace film | |
Biography | |
Buddy Cop film | |
Burlesque film | |
Chick Flick | |
Circus film | |
Comedy film | |
Black comedy | |
Gross-out film | |
Romantic comedy film |
OlderNewer