Non-school hour school

If I could, I would open a school for children, like the way Elon Musk has a school for his children, Ad Astra (Latin: to the stars).  
More

Python for fun 开心玩Python

Lately we have been enjoying playing with turtle-drawing while watching this excellent series of videos of learning Python programming from KidsCanCode.   I place it as sticky so that it is easy for the children to find it.  I seriously had a lot of fun with these code because, even though I am an experienced programmer, programming for work is not this kind of pure fun.

Small learning steps + immediate results -> reward-> more small steps…-> more small rewards…-> repeat.
Both girls (7 and 9) are so ahead of the game.  Besides drawing, I explained the following concepts to the children although they may not remember.
IDEs
Onject oriented programming.

Victoria (our 7 year old) has been taking notes, which is compiled below:

import turtle

v=turtle.Pen()  ##v is named “Fred” in the video.  But Victoria likes her initial better than Fred for the name of the turtle

v.shape(“turtle”)

v.speed(0)

#1. a loop for drawing a series of circles that are seashell-like

for i in range(50):

v.circle(i*3)

v.left(10)

#2. a loop for drawing a red rose

v.reset()

v.color(“red”)

v.width(4)

for i in range(20):

v.circle(i*3,180) ##radius=i*3 and draw 1/2 of circle because 1/2=180/360

v.right(45)

copyright Magic Math Mandarin

#3. a loop for drawing a green lettuce-like picture

v.reset()

v.color(“green”)

v.width(5)

for i in range(100):

v.forward(i*2)

v.circle(i*2,90)

v.right(20)

#4. defining a function to draw squares so that we don’t have to type the loop again and again

def square(size): ##to define the function

for i in range(4):

v.forward(size)

v.left(90)

square(100)   ##to call the function and make it work

#5. use the square function we have defined and draw lots of “random” squares

import turtle
v=turtle.Pen()
import random
def square(size):
for i in range(4):
v.forward(size)
v.left(90)
square(100)
colorList=[“red”,”purple”,”yellow”,”green”,”orange”,”blue”,”brown”,”grey”]
v.speed(0)
v.width(5)
for i in range(100):
col=random.choice(colorList)
v.color(col)
x=random.randrange(-200,200)
y=random.randrange(-200,200)
v.up()
v.goto(x,y)
v.down()
size=random.randrange(10,200)
square(size)

copyright Magic Math Mandarin

200 random squares drawn by Victoria using turtle

#interactive

name=input(“What’s your name?”)

print(“Hello “,name)

age=int(input(“How old are you?”))  #int is to convert the string you input to a number because the program treats whatever you input (7, 8, 9, etc) as a string.

print(“Next year you will be “, age+1)

#Number guessing game: when you make a guess, try to pick the number always in the middle of the range (guess why 🙂

import random
secret=random.randrange(2, 200)
#print(secret)

guess=1
count=0
while guess !=secret:
guess=int(input(“Make a guess please:”))
count=count+1
if guess>secret:
print(“Your guess is too high.”)
elif guess<secret:
print(“Your guess is too small.”)
else:
print(“You got it! You guessed”,count,”times”)

#Fun rock, scissors and paper game

import random
moves = [‘r’,’p’,’s’]
you_win=[‘pr’,’sp’,’rs’]
play=”y”
win_count=0
tie_count=0
total_count=0
play=input(“Would you like to play? y/n”)
while play !=”n”:
    computer_move=random.choice(moves)
    your_move=input(“What is your move, r for rock, p for paper, or s for scissors:”)
    if your_move not in moves:
        print(“You have to enter r,p,s.”)
        your_move=input(“What is your move, r for rock, p for paper, or s for scissors:”)
    print(“You:”,your_move)
    print(“Me:”,computer_move)
    total_count=total_count+1
    if your_move==computer_move:
        print(“Tie”)
    tie_count=tie_count=0+1
    elif your_move+computer_move in you_win:
        win_count=win_count+1
    print(“Congratulations. You win! And you have won”,win_count, “time(s) out of “,total_count,         “times. We have”,tie_count,” tie(s).”)
    else:
        print(“Sorry, I win!”)

冬春交接之际

winter storm Stella 2017

Green buds on the branches 绿芽在树上

Spring sends off winter 春天欢送冬天

A milestone day: kids creating their own posts 孩子们创造自己的贴子

Today Elizabeth and Victoria each wrote their own posts:  Victoria wrote it on a piece of paper a few times before typing with one finger letter by letter from her laptop.  Elizabeth wrote a long post with only 1 punctuation, the period.   Nevertheless, I am so pleased to see that they are little authors now.  It reminds me of the joy of seeing them first started walking.
More

Children’s love 孩子们的爱

I felt severely under the weather today and decided to work from home instead of going to the office (I am lucky to have a job that allows flexibility).   While I was getting ready to take my children to school, I found them both at their desks, reading quietly.

“Hurry up. You are going to be late.” I said to them.

“妈妈, 我们想在家里照顾你。(mom, we want to stay home to look after you.”  Elizabeth looked at me gently.
More

Kids making money and building things 小孩也能赚钱

In his youth, he sold coke at stadium, chewing gum door to door and then delivered papers, knew how buy, sell and short stocks. He bought his own car, and a farm with his own money and investments.  He became the most successful investor in the world.

More