Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Coxall Mr-Coxall

View GitHub Profile
@Mr-Coxall
Mr-Coxall / blockpy_dict_blocks
Created Mar 6, 2020 — forked from acbart/blockpy_dict_blocks
dict_get and dict_create_with blocks for blockpy
View blockpy_dict_blocks
// 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"
View hello-colaboratory.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View hello-colaboratory.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Mr-Coxall
Mr-Coxall / ics3u-ass-2.ipynb
Created Jul 12, 2019
ICS3U - Ass #2.ipynb
View ics3u-ass-2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View area_and_perimeter.py
#!/usr/bin/env python3
#
# Created by: Mr. Coxall
# Created on: Aug 2018
# Created for: Engineering
#
# This program displays area and perimeter of a rectangle,
print ("This program will calculate the area and perimeter of a rectangle")
View twos_compliment_MicroBit.py
# 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)
View MovingKnight.lua
-----------------------------------------------------------------------------------------
--
-- main.lua
--
-- Created by: Mr. Coxall
-- Created on: Jan 2018
--
-- This file animates a charact using a spritesheet
-----------------------------------------------------------------------------------------
View KightWalking.lua
-----------------------------------------------------------------------------------------
--
-- main.lua
--
-- Created by: Mr. Coxall
-- Created on: Jan 2018
--
-- This file animates a charact using a spritesheet
-----------------------------------------------------------------------------------------
View 4-bit_full_adder.py
# 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 = []
View Explosion.lua
-----------------------------------------------------------------------------------------
--
-- main.lua
--
-----------------------------------------------------------------------------------------
-- Gravity
local physics = require( "physics" )