> Java > toys
> Java > toys
by ZweiBieren Java Toys toy stuffed monkey

(includes sources)
In lighter moments, my mind turns to toys. They've wound up here. After downloading the InstallToys.jar, put it in a destination directory and double click it. Then double click one of the named toy icons.

small toy monkey PrimeFactors

half-size image of PrimeFactors window
Answer for prime factors of 26

When the user clicks ASK ME, the toy asks "What are the prime factors of XX?" The user types in the factors and clicks CHECK. In the image, XX is 26 and the user has correctly said 2 and 13.

For a wrong answer, say 3 and 5, the toy politely reports "The product of 3 and 5 is 15"

small toy monkey SpeedsConverge

half-size image of SpeedsConverge window
Section 8 of the SpeedsConverge story

Hot coffee cools. Of course. But why? I always thought it was a statistical phenomena, but in writing this toy, I discovered that cooling is a mechanical result of the bouncing of molecules. When two molecules bounce, the outgoing speeds are inevitably between the two incoming speeds. In the example shown in the diagram, the outgoing speeds are 185.5 and 194.0; both are above the smaller incoming value of 140.0 and below the larger incoming value of 229.0.

Each section of the discussion is accompanied by an interactive illustrative diagram:

  • a collection of bouncing molecules
  • a diagram of two molecules as they bounce (shown at the right)
  • the triangles formed by vectors and their axes
All accompanied by sound effects.

Without the diagrams, the lesson looks like this.


half-size image of ColorRange window
A ColorRange Window

This is a build time tool for creating a range of 11 colors. Such a range could represent a range of values for coloring a map; perhaps temperature or TVs per household. (I have been happy choosing eight colors, but have not been satisfied with my attempts to choose eleven mutually distinguishable colors.)

The file format is simple: Eleven rows of color info. Lines beginning with '#' are comments. A combobox displays a locator for the input. This may be a file, a URL, or in one of several other formats. The pulldown box initially list two default ranges and all .txt files in the ./images directory.

Files saved are always saved to the ./images directory. Three files are saved: the text file, a .png file with one pixel per color, and an HTML file also showing the colors.

All PhysPics color tools are described in an essay.

Copyright © 2021 ZweiBieren, All rights reserved. Mar 23, 2021 20:25 GMT Page maintained by ZweiBieren