Mark Dow

    It goes against the grain of modern education to teach children to program. What fun is there in making plans, acquiring discipline in organizing thoughts, devoting attention to detail and learning to be self-critical? -- Alan Perlis 

Programmers Anonymous

Example programs and code
Blitz3D test
Screen Art  v3
Random Art v1
Wallis product
PongBox
Hearse in Swamp   

Meeting room directions

    Programmers Anonymous is an informal support group for beginning programmers, using game programming as a source for interesting algorithms and applications. No experience necessary. Participant need driven, and the first person with a question gets priority attention. Anyone at any age is welcome, unless we run out of space. Regular attendance not required, no cost.

    Currently a few of us are learning how to get things done with Blitz Basic, a procedural language, and Java and C++, both object oriented programming (OOP) languages.

    Meetings are usually on Fridays at 6:00 pm, at Straub Hall in the Brain Development Lab.
All are welcome. About 1-1/2 hours, punctuality not required. Contact Mark Dow at dow@uoregon.edu for more information. See below for directions to our meeting room.

    future topics

Resources:

The official Blitz software website

Nvu, web page generation, web authoring. Free, great.

    Making and posting a simple web page

    Games:

Burning Sand, a fantastic generalization of Falling Sand Game by Max Nagl. Configurable, save/load, standalone, great interface. Robust beta version.
    Falling Sand Game, a cool abstract 2-D physical simulation, JavaScript web app. Falling Sand Game  info, wiki, discussion.

Game sites recommended by Dave Moursund:

Ace Card Games: A no hassle, no ad site for free play of 12 different solitaire card games on the Web. Includes Klondike, FreeCell, Baker's Dozen, Yukon, Carpet, Pas Seul, Golf, Eight Off, Fortress, Spider One Suit, Spider Two Suits, and Spider Four Suits.

GameHouse Online Games: Offers a number of games that can be played online, without registering. Must watch ads while downloading (for free play of a game) is occurring. Among other categories, offers a number of Word Games that have educational value. Sudoku is available in a mode where one can set difficulty level. 

Idiot's Delight: Solitaire variations. Quoting from the Website:

Welcome to Idiot's Delight, your source for free online solitaire. This site features applets for one hundred solitaire variations that can be played on all platforms (including Macintosh and Linux) that have a browser supporting Java applets. The games allow unlimited undo and redo and have several levels of difficulty to provide a challenging (but winnable) game for all levels of players.

[Note from Moursund: The Homepage does not list all of the available games. Go to one of the games listed on the HomePage and you will see that the sidebar menu contains a longer list.]

Lego Factory: Create a model using the free Lego digital designer software. Free software (for the PC and the Mac) allows you to build three dimensional objects using virtual Lego blocks. Quoting from the Website:

Welcome to LEGO Digital Designer, also known as LDD. With the free Digital Designer software you can build absolutely anything with virtual LEGO bricks right on your computer.

    Resources for educators:

        Dave Moursund's
            Using Games in Education
            Computers in Education for Talented and Gifted Students: A Book for Elementary and Middle School Teachers
   

Example Blitz programs we've worked on:

    Text and software for Blitz language: "Game Programming for Teens", second edition, Manseesh Sethi. The book includes everything needed, particularly a program interpreter and  function library (called "BlitzBasic") with examples. The hybrid Basic/C language ("Blitz") and built-in functions are designed to make game like programs short and easy, while retaining fully general programming capabilities. MS Windows operating system environment.

    Program code (straight text, *.bb) and the stand-alone executable files (and resource files in *.zip files, MS Windows) are available for these example programs. There are some differences between BlitzBasic, Blitz3D and BlitzPlus program code, so be sure to use the correct file for your Blitz software. The executeables in the zipped files should work on any PC with MS Windows. Right click on the file links to download. Some of the executable programs are designed for screen resolutions of 1024 x 768 or larger.


Blitz3D test:  Frances' program that displays a rotating and moving cube.

Blitzz3D test screenshot, link to
Full screenshot

Blitz3DTest.zip (Executable and source code [Blitz3D])
Blitz3DTest.bb

Screen Art v3:  Frances' program that is a mash-up of a drawing program and the Random Art v1 program below.

Screen Art v3 screenshot, link to
Full screenshot

Screen_Art_v3_BlitzBasic.zip (Executable and source code [BlitzBasic])
Screen_Art_v3_BlitzBasic.bb

Random Art v1:  Frances' program displays randomly positioned and color graphics.

Random Art screenshot, link to
Full screenshot

RandomArt_v1_BlitzBasic.zip (Executable and source code [BlitzBasic])
RandomArt_v1_BlitzBasic.bb


Wallis product:  Jacob's program that calculates the first terms of  the infinite Wallis product to find an approximation of Pi:

   Pi/2 = 2 * 2 * 3 * 3 * 4 * 4 ...
          1   3   3   4   4   5 ...

As the terms get very large, rounding errors due to dividing  large integers causes the approximation to drift away from the true limiting value of the product. The rounding errors result from limited precision of the standard computer representation of real numbers.

This version finds the products through the first 100,000,000 terms. The approximation is most precise somewhere near the 50,000th term. This indicates that the computer representation of real numbers is only precise to a bit less than 16 bits (216 ~= 65,000), corresponding to the 5th decimal point (10-5, or 1/100,000) of Pi.

Wallis Product screenshot, link to
Full output screenshot

Wallis_product.zip (Executable and source code [BlitzBasic])
Wallis_product.bb


PongBox:  Program testing Blitz3D capabilities.
PongBox v2 screenshot
PongBox_v2.zip (Executable, source code [Blitz3D] and image resources)
PongBox_v2.bb

PongBox screenshot
PongBox.zip (Executable, source code [Blitz3D] and image resources)
PongBox_v1.bb


Hearse in Swamp:  Program testing Blitz3D capabilities.
Hearse in swamp screenshot
Hearse_swamp_3D.zip (Executable, source code [Blitz3D] and image resources)


EncryptString:  Irreversible encryption of a short string (<= 14 characters) to an integer.
    The encryption is irreversible in that the string is not easily found from the integer. The decryption is not unique as there may be other strings that will encrypt to the same integer.
    The same unique encryption can be used by other programs to check the identity of cheat codes (the identity of the encrypted cheat code is checked). In this way a correct cheat code can be detected without revealing what that cheat code is. BoltzmannsBox uses this scheme to implement a cheat code.
       NOTE:  The Blitz Basic and Plus code use different implementations of a random number function ( both called "Rnd"), resulting in different encryptions of the same string, depending on the Blitz version used. The executable is derived from the BlitzPlus version.
EncryptString screenshot
EncryptString.zip (Executable, source code [Basic and Plus versions])

handol_user_input: Blitz function (courtesy of Frances) for conversion between scancodes and text characters.
    We have been using this kind of function for implementing cheat codes. This version handles (handols) all lower case text key presses, and some non-printing characters. Note that non-printing characters like [up-arrow] are mapped to printing characters like "^".  In a long tradition of programmer mangling, misspelling is tolerated as long as the logic is correct :) Not well documented, no caps, and may be extended to include other characters in the future.
handol_user_input.bb

BoltzmannsBox: A 2-D sphere physical simulator.
    5/15/06 Still experimental, the code is not very clean or well documented. The physics is not quite correct yet; energy is not strictly conserved when it should be, and it can freeze up (become unresponsive) in some situations. Many improvements to be made, but the basic fun of particles in a box is worth playing with.
    5/21/06 Version .92: Better drawing of large particles. A few minor bug fixes, but still includes several physics bugs. Added encrypted cheat codes (see EncryptString), that are only know to a couple programmer's siblings and guardians.
BoltzmannsBox screenshot
BoltzmannsBox.zip (Executable, source code [Basic and Plus versions], and required resources)

LinearSpirals: Random and repeated two parameter linear spirals with randomized color cycling.
    GUI control examples including command/radio/spin buttons and integer/fraction display. Particularly interesting patterns occur at angles that are near integral fractions of 360 degrees: try 90, 120, 144 (2*360/5), and 160.
    5/5/06 LinearSpirals version 1.1: Added filled or open ovals or rectangles that bound each segment. Controls are redrawn if shape overlaps. Clicking "Random" control immediately selects new parameters. Undisclosed cheat code.
LinearSpirals screenshot
LinearSpirals.zip (Executable, source code [Basic and Plus versions], and required resources)

Spray:  Simulates a spray of droplets from a nozzle, in the direction of the cursor.
    Derived from ButtonTest (see below), Spray includes a full set of user interface buttons that indicate button and parameter min/max state, and allow interaction while the simulation is running. Simple, but engaging -- imagine playing with a hose in outer-space.
    4/6/06   Spray version 2: Several improvements, particularly code structure and documentation. Now includes experimental SprayBubbles, essentially eviscerated droplets (BlitzBasic source code and resources only).
    4/28/06 Spray version 4: Added a cheat code -- typing "yellow" toggles the droplet color to/from yellow/blue.
    To Do: Better sound effect, refine the physics of small vs. large drops, increase range of drop sizes, better contrast/color droplets.
Spray screenshot
Spray.zip (Executable, source code [Basic and Plus versions], and required resources)

ButtonTest:  A set of experimental programs that we worked on to see how to make our own buttons (mouse over a rectangle, left click, make something happen).
    The earlier versions make a red oval arc across the screen, and the later versions continuously spew out "droplets" in the direction of the current mouse position.
ButtonTest screenshot
ButtonTest.zip (BlitzBasic source code only, and required resources)  

LaRevolucion:  A basic virtual environment example that uses a photo-realistic background with apparent position controlled by mouse movement.
    Many common shoot-'em-up style games use this fundamental navigation and control logic. The program is also a good example of the use of a Type, a simple animation sequence, and mouse/keypress control.
    The background image is the previous mayoral residence in Havana, Cuba. Now (2005) it is the Museum of the Revolution (Museo de La Revolucion), presenting a chronicle of Cuba's struggle for independence from colonial rule. No political statement, or offense, is intended by this software.
    4/28/06:    Replaced explosions with dripping paint ball splat animations.
    To Do: Add small targets (maybe Bush and Castro icons) that randomly appear in the image, and record hits. Better sound effects. Still some problems with navigation at edges of image. The Basic and Plus/executable versions behave differently (Basic version leaves a paint mark) due to differences in library functions. Use a mask so paint balls don't mark sky.
LaRevolucion screenshot
LaRevolucion.zip (Executable, source code [Basic and Plus versions], and required resources)

RandomPool:  Experimental 2-D sphere physical simulator.
    The program generates balls and holes randomly, and the balls explode when they get near the holes. Not complete or well documented, the style is inconsistent, and the code structure is confusing.
RandomPool screenshot
RandomPool.zip (Executable, source code [Basic and Plus versions], and required resources)

Cryptogram: A password protected text encoder.
    The program includes an example of masked keyboard input (for password protection), the generation and display of a substitution cipher, and demonstrates the use of several text manipulation functions. It also shows how to quit the program, which needs to be handled explicitly BlitzPlus (but is handled implicitly in BlitzBasic).
    The password, currently 2brnot2b, is hard-coded. To reset the password, change the first uncommented line (strPassword$ = "[your_password]").
Cryptogram screenshot
Cryptogram_BlitzBasic.bb
Cryptogram_BlitzPlus.bb
Cryptogram.exe

 Glow! :  Smoothly changing text colors. This is Frances' first program:
GLOW! screenshot
Glow!_BlitzBasic.bb
Glow!_BlitzPlus.bb
Glow!.exe

Directions:

Meetings are usually on Fridays at 6:00 pm, at Straub Hall in the Brain Development Lab.
All are welcome. About 1-1/2 hours, punctuality not required. Contact Mark Dow at dow@uoregon.edu for more information.
From 18th take University Ave. onto the UofO campus, right on E. 15th to15th and Onyx. The Brain Develoment Lab is on the south side of Straub Hall ground-floor door. See map below. Knock on the single door on the south side of Straub, on 15th Ave. Metered parking is free after 6:00.
map for Programmers Anonymous meeting room
Document made with Nvu