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
import os | |
from itertools import product | |
from random import randint | |
from time import sleep | |
class Cell: | |
def __init__(self, state): | |
self._state = state | |
self._future_state = state |
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
// The raw blocks | |
Blockly.Msg.TYPE_CHECK = "check type of" | |
Blockly.Msg.DICT_KEYS = "get all keys of " | |
Blockly.Msg.DICT_GET = "get value of key" | |
Blockly.Msg.DICT_GET_TO = "from" | |
Blockly.Msg.DICTS_CREATE_WITH_INPUT_WITH = "dict of" | |
Blockly.Msg.DICTS_CREATE_WITH_TOOLTIP = "Create a new dictionary" | |
Blockly.Msg.DICTS_CREATE_EMPTY_TITLE = "Create empty dict" | |
Blockly.Msg.DICTS_CREATE_WITH_CONTAINER_TITLE_ADD = "key-value pairs" |
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
# Created by: Mr. Coxall | |
# Created on: Sep 2018 | |
# Created for: ICS3U | |
# This program shows the difference between local and global variables | |
import ui | |
variableX = 25 | |
def local_button_touch_up_inside(sender): |
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
# Created by: Mr. Coxall | |
# Created on: Sep 2018 | |
# Created for: ICS3U | |
# This program calculates the cost of a pizza, give the diameter | |
import ui | |
def calculate_button_touch_up_inside(sender): | |
# calculate circumference | |
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
# Created by: Mr. Coxall | |
# Created on: Sep 2018 | |
# Created for: ICS3U | |
# This program calculates the circumference of a circle, | |
# when you give it the radius | |
import ui | |
def calculate_touch_up_inside(sender): | |
# calculate circumference |
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
# Created by: Mr. Coxall | |
# Created on: Aug 2018 | |
# Created for: ICS3U | |
# This program displays area and perimeter of a rectangle, | |
# but this time the user can enter different lengths and widths | |
import ui | |
def calculate_button_touch_up_inside(sender): | |
# calculate area and perimeter |
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
# Created by: Mr. Coxall | |
# Created on: Aug 2018 | |
# Created for: ICS3U | |
# This program shows images | |
import ui | |
# first get a reference to the image you saved in your Python folder | |
my_pic = ui.Image.named('./sprites/MT_crest.jpg') |
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
# Created by: Mr. Coxall | |
# Created on: Aug 2018 | |
# Created for: ICS3U | |
# This program displays the school name and their mascot | |
import ui | |
def mother_teresa_touch_up_inside(sender): | |
# displays the school and mascot for MT | |
view['school_name_label'].text = 'Mother Teresa HS' |
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
# Created by: Mr. Coxall | |
# Created on: Sep 2018 | |
# Created for: ICS3U | |
# This program calculates the area and perimter of a rectangle | |
import ui | |
def answer_touch_up_inside(sender): | |
# displays the answer for area and perimeter | |
view['area_answer_label'].text = 'Area = ' + str(3*5) + ' cm^2' |
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
# Created by: Mr. Coxall | |
# Created on: Aug 2018 | |
# Created for: ICS3U | |
# This program does basic math | |
import ui | |
def equation1_touch_up_inside(sender): | |
# displays the answer to equation 1 | |
NewerOlder