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
<iframe src="https://scratch.mit.edu/projects/PROJECTID/embed" width="800" height="600"></iframe> |
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 | |
os.system("cls") #use this for windows. change to os.system("clear") for linux | |
COLORS = {\ | |
"black":"\u001b[30;1m", | |
"red": "\u001b[31;1m", | |
"green":"\u001b[32m", | |
"yellow":"\u001b[33;1m", | |
"blue":"\u001b[34;1m", |
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 time, os, random | |
ranks = ["Ace","2","3","4","5","6","7","8","9","10","Jack","Queen","King"] | |
suits = ["Clubs","Hearts","Diamonds","Spades"] | |
deck = [] | |
value = 1 | |
for rank in ranks: | |
for suit in suits: | |
deck.append([rank + " of " + suit, value]) |
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
#Full tutorial video available at - http://learnlearn.uk/raspberrypi/2018/08/29/make-teleporter-minecraft-using-python/ | |
import mcpi.minecraft as minecraft | |
import mcpi.block as block | |
import time | |
mc = minecraft.Minecraft.create() | |
mc.postToChat("Welcome to my teleporter") |
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 random, time,os | |
while True: #infinite loop | |
os.system('cls') # linux - clear | |
print("Welcome to the waiting game!") | |
print("\n\n") | |
print("Instructions\n") | |
print("You will be told to wait a number of seconds.") | |
print("Wait that number of seconds and then press ENTER") | |
print("Are you ready? Press ENTER to start...") |
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 mcpi.minecraft as minecraft | |
import mcpi.block as block | |
import random, time | |
mc = minecraft.Minecraft.create() | |
def drawPillar(x): |
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 random,time | |
userScore = 0 | |
compScore = 0 | |
choices = ["r","p","s"] | |
rnd = 1 | |
while True: #Infinite Loop |
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,sys,time | |
sl = [] | |
try: | |
f = open("shopping2.txt","r") | |
for line in f: | |
sl.append(line.strip()) | |
f.close() | |
except: | |
pass |
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 datetime,time,math | |
import mcpi.minecraft as minecraft | |
import mcpi.block as block | |
mc = minecraft.Minecraft.create() | |
mc.setBlocks(-100,0,-100,100,100,100,block.AIR) | |
def drawTower(tx,ty,tz): |
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 csv | |
f = open('scores.csv','a') # 'a' stands for APPEND / ADD TO | |
# use 'w' if you want to replace the whole file's contents... | |
writer = csv.writer(f) | |
fname = input("First name: ") | |
lname = input("Last name: ") |