[Edu-sig] teaching in a classroom again...

kirby urner kirby.urner at gmail.com
Thu Aug 2 16:31:35 CEST 2012


I've again been teaching teens, no my usual practice these days, but a
fun variation on the theme.

Saturday Academy kids are self selected and tend not to have ego
problems around whether they're "smart enough" or whatever it takes.
The all believe they have the "right stuff" ultimately.

The classroom is probably the best I've had, in terms of being able to
project content on the big screen.  I have a button to lower the
blinds.

I used to think Hewlett-Packard would go into the classroom design
business as there's more one could do.  Once could have a button to
project each student's console to the front, for example, perhaps
under the teacher's control.

That takes software, not just hardware.  You'd need to work it out
from the ground up.  Ideally, the school is build like a theater or
holodeck, to accommodate all sorts of classroom configurations.  Of
course we don't really have such schools today, unless you count
Universal Studios.

I've uploaded some pix to Flickr:

http://www.flickr.com/photos/kirbyurner/7680435316/in/photostream

http://www.flickr.com/photos/kirbyurner/7680433664/in/photostream/

(etc. to the left and right of those)

These are middle school aged, so like averaging 14 or so years old.

What I do is intersperse mini-talks on Python with hands on play with
showings of Youtubes.

Yesterday we zoomed in on Mandelbrot sets before lunch, then switched
to Mandelbulb fly-throughs after lunch.

I have them for two hours, with a lunch break in between of under an hour.

The title of the course is 'Martian Math and Programming in Python'.
The Martian part is rather subtle in that I just plant some ideas.

I bring a large tetrahedron to the room, plus carry it through the
halls, turning heads.

In other versions of this course I might dwell on a particular
storyboard / story problem wherein Earthlings and ETs are working
together on a big dam (hydro-electric) but measure concrete in
different units (cube vs tetrahedron respectively).

Here's some code I'll be taking on memory stick today, reviewing some
of what we've been doing.

We're using Python 2.7 + VPython on Win7.

===
"""sa1.py"""

from visual import *
import math

def ballmatrix( ):
    for x in range(-10, 10):
        for y in range(-10, 10):
            sphere(radius=.5, pos=(x,y,0))

def hidef( ):
    for x in range(-100, 100):
        for y in range(-100, 100):
            sphere(radius=.5, pos=(x,y,0))

def mandelbrot( ):
    for r in range(-40, 10):
        for i in range(-20, 20):
           c = complex(r/10.0, i/10.0)
           z = 0
           for times in range(10):
               z = z*z + c
               if abs(z) < 1:
                   sphere(radius=.5, pos=(r,i,0), color = color.black)
               else:
                   sphere(radius=.5, pos=(r,i,0), color = color.red)


def mandelbrot2( ):
    for r in range(-40, 10):
        for i in range(-20, 20):
           c = complex(r/10.0, i/10.0)
           z = 0
           for times in range(10):
               z = z*z + c
               thelength = abs(z)
               if thelength < 1:
                   sphere(radius=.5, pos=(r,i,0), color = color.black)
               elif 2 >= thelength >= 1:
                   sphere(radius=.5, pos=(r,i,0), color = color.red)
               elif 5 >= thelength >= 2:
                   sphere(radius=.5, pos=(r,i,0), color = color.orange)
               elif 20 >= thelength >= 5:
                   sphere(radius=.5, pos=(r,i,0), color = color.green)
               else:
                   sphere(radius=.5, pos=(r,i,0), color = color.blue)

mandelbrot2()

===
""" sa2.py """

from visual import *
import math

"""
color = (r, g, b) where r,g,b are between 0 and 1.  red green blue
"""

def colorchange():
    g, b = 0, 0
    for r in range(0, 100):  # increase red from 0 to 1
       ball = sphere(radius=10, color=(r/100.0, g, b))
       rate(50)
       ball.visible = False
       del ball
    r, b = 1, 0
    for g in range(0, 100):  # increase green from 0 to 1
       ball = sphere(radius=10, color=(r, g/100., b))
       rate(50)
       ball.visible = False
       del ball
    g, b = 1, 1
    for b in range(0, 100):  # increase blue from 0 to 1
       ball = sphere(radius=10, color=(r, g, b/100.))
       rate(50)
       ball.visible = False
       del ball
    ball = sphere(radius=10, color=(1,1,1))  # white


colorchange()

===
""" sa3.py """

from visual import *
import math
from random import randint


def say_something():
    """
    Get something from the user to display
    """
    saywhat = raw_input("What shall I print? ")

    text(text=saywhat,
        align='center', depth=-0.3, color=color.green)


def rand_color():
    """
    pick three random numbers between 0 and 1, e.g. 0.5 or 0.3
    """
    r = randint(0,100)/100.
    g = randint(0,100)/100.
    b = randint(0,100)/100.
    return (r,g,b)


def say_alphabet():
    x = -25  # offset to the left
    for c in "ABCDEFGHIJKLMNOPQRSTUVWZYZ":  # jump through each letter
        text(text=c, pos=(x,0,0),
            align='center', depth=-0.3, color=rand_color())
        x = x + 1.5 # to the the right a bit

say_alphabet()  # change this to point to different functions at runtime




Kirby


More information about the Edu-sig mailing list