Slashdot Mirror


User: day418

day418's activity in the archive.

Stories
0
Comments
1
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 1

  1. Re:Something With Immediate Visual Feedback on Best Introduction To Programming For Bright 11-14-Year-Olds? · · Score: 1

    I would use the turtle graphics which comes standard with Python. It is visual, simple, and you could use this environment to introduce many programming concepts like iteration and procedure calls. Python is also rich enough that you could stay in this environment for OOP, etc.
    Consider the following interactive session in python:

    >>> from turtle import *
    >>> setup()
    >>> title("turtle test")
    >>> clear()
    >>>
    >>> #DRAW A SQUARE
    >>> down() #pen down
    >>> forward(50) #move forward 50 units
    >>> right(90) #turn right 90 degrees
    >>> forward(50)
    >>> right(90)
    >>> forward(50)
    >>> right(90)
    >>> forward(50)
    >>>
    >>> #INTRODUCE ITERATION TO SIMPLIFY SQUARE CODE
    >>> clear()
    >>> for i in range(4):
            forward(50)
            right(90)
    >>>
    >>> #INTRODUCE PROCEDURES
    >>> def square(length):
            down()
            for i in range(4):
                    forward(length)
                    right(90)
    >>>
    >>> #HAVE STUDENTS PREDICT WHAT THIS WILL DRAW
    >>> for i in range(50):
            up()
            left(90)
            forward(25)
            square(i)
    >>>
    >>> #NOW HAVE THE STUDENTS WRITE CODE TO DRAW
    >>> #A SQUARE 'TUNNEL' (I.E. CONCENTRIC SQUARES
    >>> #GETTING SMALLER AND SMALLER).
    >>>
    >>> #AFTER THAT, MAKE THE TUNNEL ROTATE BY HAVING
    >>> #EACH SUCCESSIVE SQUARE TILTED

    In trying to accomplish the last two assignments, they will have many failed attempts, but the failures will be visually interesting and they'll learn quickly as they try to figure out why it didn't draw what they expected.