The Best of Creative Computing Volume 2 (published 1977)

Page 31 << PREVIOUS >> NEXT Jump to page:
Go to contents Go to thumbnails
This book is also available for the Kindle

The Computer "Glass Box" - Teaching with A Programming Language (psychology)

graphic of page

V DRILL
[1] NEWPROBLEM:

[2] 'MULTIPLY'

[3] [image] + FIRST + 720
[4] [image] + SECOND + 720
[5] ENTER: ANSWER + [image]
[6] [image]NEWPROBLEM IF ANSWER=FIRSTSECOND
[7] 'NOPE. TRY AGAIN.'

[B] [image]ENTER
V

The student may ENTER his ANSWER which is then judged for correctness by the
program. IF the ANSWER equals the FIRST number times the SECOND number, a
NEWPROBLEM is given; otherwise (if ANSWER is wrong) 'NOPE. TRY AGAIN.' is
printed, and the student may ENTER his answer again.

NOTE: IF is a sub-program used to facilitate the reading of branching commands.
Its definition is:

V BRANCH + LINE IF CONDITION
[1] BRANCH + CONDITION/LINE
V

Its syntax is -> (line number) IF (condition)

It means that IF the condition is true (evaluates to 1), the program branches to
the line number (or line label) given; IF the condition is false (evaluates to
0), the program branches to the next line.

In order to use the DRILL program, its name is typed. The following is a sample:

DRILL
MULTIPLY
19
2
[image]:

38
MULTIPLY
16
18
[image]:

248
NOPE. TRY AGAIN.

[image]:

288
MULTIPLY
8
12
[image]:

96
MULTIPLY
6
2
[image]:

12
MULTIPLY
14
18
[image]:

Students notice immediately that this program has a flaw. It does not stop!
Scrutinizing the program's definition reveals that after getting a
multiplication problem correct, one always gets a new problem - ad infinitum.
Also, after getting a problem wrong, the student must answer that same problem
again - another potentially endless loop. The student's first task, then, might
be to build in an option to stop the program at will.

DRILL is, of course, only a prototype program. With other modifications of one's
choosing, DRILL may become considerably more sophisticated. Possible extensions
include: (a) displaying pictorial feedback - like a "smiley face" for positive
reinforcement or a "grouchy face" instead of 'NOPE. TRY AGAIN.', (b) presenting
a pre specified total number of problems, (c) limiting the number of allowable
mistakes on individual problems (or all problems), (d) generalizing the
multiplicands to create a more flexible range of problems (including negative
numbers, decimals, etc.), (e) gathering performance data, (f) using performance
criteria to make diagnoses, (g) automatically adapting level of difficulty based
on diagnoses, (h) adding personalized instructions, and (i) building in timing
components, jump-ahead options and hints.

[image]
[image]

PSYCHOLOGY

With computer programs suitable for viewing, students may learn some
fundamentals of psychology. In studying behavior, for example, consider the
following APL program1 which models - albeit crudely - an emotional reaction.

V TEMPER
[1] EMOTION = 0
[2] NEW: EMOTION = [image] + EMOTION[image]2
[3] [image]MAD IF EMOTION>10
[4] [image]NEW
[5] MAD: '!?!?!!'

V
[image]TEMPER is a program which will, under certain conditions, 'get mad at
you'.

The program begins with zero EMOTION and then encounters a series of numbers,
representing 'events' in the life of the program. A low number is low in
emotional significance; whereas high numbers are highly emotion producing.

Each time a number is entered, the program generates a NEW EMOTION based on a
simple mathematical model: EMOTION becomes the number just entered plus one half
of the previous EMOTION. (In the course of human events, this might be akin to
the ameliorating effect of time on emotional burdens, i.e. 'sleeping on your
troubles'.)

This process continues until a test condition - the "threshold" for mad behavior
- is exceeded. The program goes MAD if EMOTION ever becomes greater than 10.
(!?!?!! is the computer's programmed vernacular.)

To use the program, the child types its name (TEMPER) and then enters a sequence
of numbers. For example:

TEMPER
[image]:

4
[image]:

6
[image]:

8
!?!?!!

This sequence produced MAD behavior.

But, suppose one tries entering the same numbers in a different order:

TEMPER
[image]:

8
[image]:

6
[image]:

4
[image]:

[image]

Here, the program does not display MAD: '!?!?!!'. Apparently, (for this model)
the sequence 8 6 4 is "tolerable," whereas the previous sequence 4 6 8 clearly
was not tolerable!

[image]1 This program is similar to one written in a simplified FORTRAN by John
Loehlin in Computer Models of Personality, Random House, NY, 1968.

31

Page 31 << PREVIOUS >> NEXT Jump to page:
Go to contents Go to thumbnails
This book is also available for the Kindle