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 is the Hello, World program, but with 3 buttons | |
import ui | |
def english_touch_up_inside(sender): | |
# displays the English version | |
view['hello_world_label'].text = ('Hello, World!') |
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 is the Address program, but with a GUI | |
import ui | |
v = ui.load_view() | |
v.present('sheet') |
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 is the Hello, World program, but with a GUI | |
import ui | |
view = ui.load_view() | |
view.present('sheet') |
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" ) |