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
# Mr. Coxall | |
from microbit import * | |
def convert_dec_to_bin(int_number, binary_digits): | |
# convert a decimal number to binary stored in an array | |
if int_number < 0: | |
# it is a negative number | |
positive_equivalent = pow(2, binary_digits)-abs(int_number)-1 | |
answer = bin(~positive_equivalent) |
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
----------------------------------------------------------------------------------------- | |
-- | |
-- main.lua | |
-- | |
-- Created by: Mr. Coxall | |
-- Created on: Jan 2018 | |
-- | |
-- This file animates a charact using a spritesheet | |
----------------------------------------------------------------------------------------- |
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
----------------------------------------------------------------------------------------- | |
-- | |
-- main.lua | |
-- | |
-- Created by: Mr. Coxall | |
-- Created on: Jan 2018 | |
-- | |
-- This file animates a charact using a spritesheet | |
----------------------------------------------------------------------------------------- |
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
# Mr. Coxall | |
# This Micro:Bit Python code goes through all the combinations of 2 44-bit positive binary numbers | |
from microbit import * | |
# variable holding the decimal value of a button | |
a_input = 0 | |
a_input_as_binary = [] | |
b_input = 0 | |
b_input_as_binary = [] |
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
----------------------------------------------------------------------------------------- | |
-- | |
-- main.lua | |
-- | |
----------------------------------------------------------------------------------------- | |
-- Gravity | |
local physics = require( "physics" ) |
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
----------------------------------------------------------------------------------------- | |
-- | |
-- main.lua | |
-- | |
----------------------------------------------------------------------------------------- | |
-- Gravity | |
local physics = require( "physics" ) |
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
----------------------------------------------------------------------------------------- | |
-- | |
-- main.lua | |
-- | |
----------------------------------------------------------------------------------------- | |
-- Gravity | |
local physics = require( "physics" ) |
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
----------------------------------------------------------------------------------------- | |
-- | |
-- main.lua | |
-- | |
----------------------------------------------------------------------------------------- | |
-- Collision | |
local physics = require( "physics" ) |
NewerOlder