This file contains hidden or 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
from scene import * | |
import sound | |
class GameEnvironment(object): | |
def __init__(self): | |
self.background_speed = 1 | |
class MyScene (Scene): | |
def setup(self): |
This file contains hidden or 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
from scene import * | |
from PIL import Image | |
import sound | |
import random | |
GAME_READY = 0 | |
GAME_PLAY = 1 | |
GAME_DYING = 2 | |
GAME_DEAD = 3 |
This file contains hidden or 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
# The eight queens puzzle game | |
import ui, sound, speech | |
from collections import deque | |
nqueens = 10 | |
v = ui.View(background_color=(0.40, 0.80, 1.00)) | |
board = ui.View() | |
v.add_subview(board) | |
v.present('full_screen', hide_title_bar=False , orientations=['landscape']) | |
#steps_label = ui.Label() |
This file contains hidden or 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
# The eight queens puzzle game | |
import ui, sound, speech | |
from collections import deque | |
nqueens = 4 | |
v = ui.View(background_color=(0.40, 0.80, 1.00)) | |
board = ui.View() | |
v.add_subview(board) | |
v.present('full_screen', hide_title_bar=False , orientations=['landscape']) | |
#steps_label = ui.Label() |
This file contains hidden or 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
# The eight queens puzzle game | |
import ui, sound, speech | |
from collections import deque | |
nqueens = 4 | |
v = ui.View(background_color=(0.40, 0.80, 1.00)) | |
board = ui.View() | |
v.add_subview(board) | |
v.present('full_screen', hide_title_bar=False , orientations=['landscape']) | |
#steps_label = ui.Label() |
This file contains hidden or 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
''' | |
Using Breadth-First Search to solve the 8-puzzle | |
Author: Yuhang Wang | |
''' | |
from collections import deque | |
def isAdjacent(row1, col1, row2, col2): | |
if abs(row1-row2) + abs(col1-col2) == 1: | |
return True |
This file contains hidden or 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
# The eight queens puzzle game | |
import ui, sound, speech | |
nqueens = 8 | |
v = ui.View(background_color=(0.40, 0.80, 1.00)) | |
board = ui.View() | |
v.add_subview(board) | |
v.present('full_screen', hide_title_bar=False , orientations=['landscape']) | |
#steps_label = ui.Label() | |
#steps_label.frame = (30, 30, 250, 70) |
This file contains hidden or 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
# The eight queens puzzle game | |
import ui | |
v = ui.View(background_color=(0.40, 0.80, 1.00)) | |
board = ui.View() | |
v.add_subview(board) | |
v.present('full_screen', hide_title_bar=False , orientations=['landscape']) | |
#steps_label = ui.Label() | |
#steps_label.frame = (30, 30, 250, 70) | |
#steps_label.background_color = (1.00, 0.00, 0.50) |
This file contains hidden or 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
import ui | |
import speech | |
import random, time | |
import requests | |
import json | |
import random | |
import urllib | |
from collections import deque | |
END_POINT = 'http://192.168.1.8:5000/puzzlescores' |
This file contains hidden or 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
''' | |
Using Breadth-First Search to solve the three puzzle | |
Author: Yuhang Wang | |
''' | |
from collections import deque | |
def isAdjacent(row1, col1, row2, col2): | |
if abs(row1-row2) + abs(col1-col2) == 1: | |
return True |