Tuesday, May 6, 2014

Friendstrument How-To


Look for the complete step-by-step for The Friendstrument on Boing Boing. It will run there on Wednesday, May 7. If you can't wait that long, you may purchase the entire Maker Dad book with 24 projects, as a Kindle ebook right now for $6.99!

Saturday, June 29, 2013

Sunday, May 5, 2013

Grime's Dice simulator

Python program for Grime's Dice:
#Grime's Dice Simulator

#Variables to count how many times a particular color wins a 30-rolls game
bluewins = 0
greenwins = 0

#y is how many 30-rolls games you want to play
for y in range(0, 1000):

 #Variables to count how many times a particular color wins in a 30-rolls game
 bluetotal = 0
 greentotal = 0

 #x is how many rolls
 in a game
 for x in range(0, 30):
 
 
  #Blue die has five 3s and one 6
  import random
  roll = random.randint(1,6)
  if roll >  5:
   blue = 6
  else:
   blue = 3
   
   
  #Green die has three 5s and three 2s
  import random
  roll = random.randint(1,6)
  if roll >  3:
   green = 5
  else:
   green = 2
   
 
 
 # import random
 # roll = random.randint(1,6)
 # if roll >  5:
 #  purple = 1
 # else:
 #  purple = 4
   
 
  if blue > green:
   bluetotal = bluetotal + 1
  else:
   greentotal = greentotal + 1
 
 if bluetotal > greentotal:
  bluewins = bluewins + 1
 else:
  greenwins = greenwins + 1
  
print "Blue", bluewins
print "Green", greenwins