Sample Programs

See "Using the Tape Drive" for instructions on how to load programs, and to verify the program loaded correctly.

countdown.w6t - Count Down timer

VERIFY PROG: 210

USE: Enter a number and press GO. This display will count down that number until 0.

This program demonstrates basic use of ALPHA STOP and program loops.

celsius.w6t - Convert Degrees Fahrenheit to Celsius

VERIFY PROG: 193

USE: Enter degrees Fahrenheit and press GO. The display will show the equivalent degrees Celsius.

This program demonstrates how to do basic math calculations using registers.

zeller.w6t - Compute Day of Week given Month/Day/Year

VERIFY PROG: 679

USE: Turn printer on. Enter month (1-12), press GO. Enter dat (1-31), press GO. Enter 4-digit year, press GO. Display will show 0-6 for Saturday through Friday. Prints month, day, and year as they are entered, then prints result.

Uses a formula known as "Zeller's Congruence" to compute the day-of-week.

factorial.w6t - Compute Factorials

VERIFY PROG: 315

USE: Enter a number and press GO. The display will show the result of N!. Note, N! or "N Factorial" is the product of

N * (N-1) * (N-2) ... * 1

This program is from Rick Bensene's Old Calculator Museum, http://www.oldcalculatormuseum.com/wang600.html.

prime_nums.w6t - Find Prime Numbers

VERIFY PROG: 498

USE: Turn on Printer and press GO. The program still start at 2 and print all prime numbers.

This program is from Alf Urban, http://www.genealpha.de/wang/.

hello.w6t - Simple Example of the Model 601 OutputWriter

VERIFY PROG: 218
  • If not already done, use the Devices -> Output Devices menu to connect one of the OutputWriter models (601, 602, or 611).
  • Press GO

    The OutputWriter window should appear with the text "Hello World!" printed on it.

    This program demonstrates how to print a text string to the OutputWriter.

    graph_sin.w6t - Example of Plotting Graphs on the 602 Plotting OutputWriter

    VERIFY PROG: 595

  • If not already done, use the Devices -> Output Devices menu to connect the 602 Plotting OutputWriter.
  • If not already done, use the Devices -> Expansion ROM menu to install the ROM image "libplot.w6x".
  • Press GO.

    The OutputWriter window should appear and a graph of a sine wave is plotted on it. Note, the plotting takes up to a minute to complete, however progress should be visible as it is being plotted. The default OutputWriter window is not large enough to show the entire graph, so it may be resized as desired.

    This program demonstrates a very simple graphing program, using fixed scaling. It is tailored to plotting functions that fit within a -1 to +1 range of 'f(x)' and a 0 to 360 range if 'x'.

    craps.w6t - Game of Craps

    VERIFY PROG: 1589

    USE: Optionally enter a random number (use decimal places), then press GO. The number 500 should appear on the display. This is your bank. Enter a bet and press GO. The first dice roll will appear for 0.5 second. If it is a win, the display will flash for 0.5 second and then you will see your new bank and can enter a new bet. If it is a lose, the display will blank for 0.5 second and then you will see your updated bank and can bet again. If the number is a "point", then repeated dice rolls will display for 0.5 second each, and the appropriate action taken (win, lose, repeat).

    This program demonstrates use of the random number generator and simple game simulation. It also shows use of "special effects" like making the display flash without aborting the program, and making the display blank.

    calendar.w6t - Prints one month calendar on OutputWriter

    VERIFY PROG: 3621

  • If not already done, use the Devices -> Output Devices menu to connect one of the OutputWriter models (601, 602, or 611).
  • Enter month (1-12) and press GO
  • Enter year (4-digits) and press GO.

    Calendar for the given month/year should appear on the OutputWriter window.

    hex2dec.w6t - Crude hexidecimal-to-decimal converter

    VERIFY PROG: 1135

    Set the "f(x)" pushbutton down (on). Use the keys "00" - "15" to enter hex digits, the decimal value will accrue on the display. Use PRIME or CLEAR DISPLAY to start a new conversion.

    example1.w6t - "Example 1" from the Wang 2202 Reference Manual

    VERIFY PROG: 832

  • If not already done, use the Devices -> Output Devices menu to connect the 602 Plotting OutputWriter.
  • Press GO

    The pattern described in the example should appear, namely a swirl pattern of colons, asterisks, and periods.

    plot_sin.w6t - Draw a sine-wave graph on the 612 Flatbed Plotter

    VERIFY PROG: 714

  • If not already done, use the Devices -> Output Devices menu to connect the 612 Flatbed Plotter.
  • If not already done, use the Devices -> Expansion ROM menu to install the ROM image "libplot.w6x".
  • Press GO

    The graph of a sine wave, with axii and labeling, will appear on the plotter window.

    plot_dat.w6t - Plots data samples from a tape file

    VERIFY PROG: 1080

  • If not already done, use the Devices -> Output Devices menu to connect the 612 Flatbed Plotter.
  • If not already done, use the Devices -> Expansion ROM menu to install the ROM image "libplot.w6x".
  • Mount the tape image "temperature.w6t" and set Tape Ready.
  • Press GO

    The graph of the temperature data, with axii and labeling, will appear on the plotter window.

    Data file image is created by the "wpcc" utility "w6data2tape". It produces a file with two tape images, first one contains the number of datapoints in a single register, the second contains all the datapoints.

    list_dat.w6t - Lists datapoints from a tape file

    VERIFY PROG: 3611

  • If not already done, use the Devices -> Output Devices menu to connect one of the OutputWriter models (601, 602, or 611).
  • Mount the tape image "temperature.w6t" and set Tape Ready.
  • Press GO

    A tabular list of the datapoints in the tape image will be printed.

    plot_alpha.w6t - Demonstrates the character set of the 612 Plotter

    VERIFY PROG: 1171

  • If not already done, use the Devices -> Output Devices menu to connect the 612 Flatbed Plotter.
  • If not already done, use the Devices -> Expansion ROM menu to install the ROM image "libplot.w6x".
  • Press GO

    The complete character set, in three different sizes, will be drawn on the plotter.

    example607.w6t - Demonstrates one way to use the Model 607 Teletype

    VERIFY PROG: 897

  • If not already done, use the Devices -> Output Devices menu to connect the 607 Teletype.
  • Using "telnet", or some other suitable client, connect to the Wang 700 simulation.
  • Press GO. An introduction and prompt for data should appear on the "telnet" session.
  • From the "telnet" session, type a number and press "Enter" (Return).
  • The equivalent temperature in Celsius, and a new prompt, should be printed.

    The program repeats indefinitely, until PRIME is pressed on the calculator. If the client disconnects, the program will still be running and a new client can be connected (although in that case the prompt is not re-printed).

    libplot.w6x - Expansion ROM image for plotting/graphing routines

    Required by some of the above programs.

    Source Code

    The above programs (and data) are available in "source" format in the "wpcc.tgz" package.