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
# getting the Ottawa weather forcast into a dictionary | |
import requests | |
weather_forcast = {} | |
response = requests.get('https://weather.gc.ca/wxlink/site_js/s0000623_e.js').text | |
weather_output = response.splitlines() | |
print("Got weather") |
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 | |
-- | |
----------------------------------------------------------------------------------------- | |
-- Jump | |
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 | |
-- | |
----------------------------------------------------------------------------------------- | |
-- Character move | |
local dPad = display.newImage( "./assets/sprites/d-pad.png" ) | |
dPad.x = 150 |
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
-- Comprehensive touch code | |
local theBall = display.newImage( "./assets/sprites/ball.png" ) | |
theBall.x = display.contentCenterX | |
theBall.y = display.contentCenterY | |
theBall.id = "ball object" | |
function theBall:touch( event ) | |
if ( event.phase == "began" ) then | |
print( "Touch event began on: " .. self.id ) |
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
-- simple touch code | |
local theBall = display.newImage( "./assets/sprites/ball.png" ) | |
theBall.x = display.contentCenterX | |
theBall.y = display.contentCenterY | |
theBall.id = "ball object" | |
local function onBallTouched( event ) | |
if ( event.phase == "began" ) then | |
print( "Touch event began on: " .. event.target.id ) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>esptool.js</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/xterm/2.9.2/xterm.min.js" integrity="sha256-8rsVcpCnO6HdeJL84i0VdubjM42fjSmO8aONghdq3gc=" crossorigin="anonymous"></script> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/xterm/2.9.2/xterm.min.css" integrity="sha256-w69o8Y6P5VZjfYFmn2KlqMU7TUi2I+oWObi8FLlVZZg=" crossorigin="anonymous" /> | |
</head> |
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
----------------------------------------------------------------------------------------- | |
-- | |
-- command line Lua | |
-- | |
-- show how to use an if statement | |
-- and random numbers | |
-- | |
----------------------------------------------------------------------------------------- | |
math.randomseed( os.time() ) |
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: Feb 2018 | |
* | |
** Connect the ESP8266 unit to an existing WiFi access point | |
** For more information see http://42bots.com | |
* | |
* Updated by Mr. Coxall to connect to school network | |
*/ |
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: Feb 2018 | |
* | |
* This sketch is the standard "Blink" sketch | |
* to ensure you can actually connect and load a sketch | |
* I have also added a serial print, so that I know that is also working | |
* I have had to set it to 9600 baud to make it work correctly | |
*/ | |