Commit Graph

54 Commits

Author SHA1 Message Date
Joshua Bell 6278f871fb Several sample fixes/improvements by Alan Ratliff
**In "Simple Pong" I eliminated the problem of the bouncing ball erasing the bottom wall of the field, created a means of scoring points (when the ball gets past a paddle and hits the "back wall", the other player scores a point -- one point each time the ball gets past the paddle, so that multiple impacts that typically occur don't count a point each), and allowed the possibility of equiangular bouncing off the paddles, instead of always just bouncing straight back along the same trajectory.

Also, this game isn't really suited for "paddle"-type control on this platform, as there is typically just one mouse for that purpose, not practical for two players. However, with key-control, the comments cited a problem of needing to be able to handle multiple keystrokes. As it was, when one player pressed a directional key, their paddle would start moving and not stop until it hit its upper/lower limit. It would stop, though, if a non-operational key were pressed, or one of the other player's keys. This latter meant that one player hitting a key to move their paddle would stop the other player's paddle from moving, which was where the real problem occurred. Underlying this was the fact all movement was controlled by the single last key pressed. I changed it by introducing variables to control the movement of each paddle which would be set by the appropriate keystrokes. I also added a specific key for each player to stop their paddle's motion, as well as duplicate directional keys so that each player's key group would be suitable for either the left or right hand: with either hand they could press "down" with the index finger, "stop" with the middle finger, and "up" with the fourth finger.

***With "Hangman", I did the usual random-seeding, avoided the initial-keystroke-termination problem, and simplified the word-choosing algorithm, and set it to go through all words in a difficulty-group, then continue by choosing among the 9 words in that group least-recently used. I also incorporated level-change options in the new-game menu, and I greatly reduced the code for the circle-drawing routine (while still utilizing principles of geometry), and re-organized the parts-drawing routines so the "smiley face" routine could be simplified.

***Next is the "Door Detector" game program. Its problems were subtle ones, principally that it would occasionally crash with an "Illegal quantity error in line 320". This concerned the value of "G" that was assigned as COLOR. This crash was quirky, as the program maintained the value of G between 0 and 15 in some places, but not others, while supposedly the value given to COLOR is not "Illegal" unless it's outside the byte-range 0-255; within that range the value merely has its lower nybble isolated to serve as the COLOR value. I put in a tweak to print the value of G to be used in line 320, and upon a crash it was shown as 50. I'm not sure why it occurred this way, but I figured that a way to be safe would be to just *always* ensure that G is kept in the range 0 to 15.

The program also had the "standard" problem that it didn't seed the random-number generator, so it always played an identical "game sequence" every time, instead of different permutaions as you'd normally expect with "random numbers".

Another "subtle" shortcoming I noticed concerned the fact that in successive "rooms" within a game, the "Death Zone" is an incrementally "thick" border region around the room, and in any given room the "exit" could be randomly placed right next to the "Death Zone's" edge, and as the player would start the next room where the previous room's exit was, a next-to-Death-Zone exit would mean the player would start the next room IN the Death Zone (its innermost layer). As it happened, in the one game-sequence that occurred, the final room's exit in the first game was along the Death Zone's edge, but as it was the FINAL room anyway, the next-room starting location was not an issue. I figured, though, that with the game properly randomized, the issue COULD come up, so I now use line 50 (commented in 40) to bump the player out of the Death Zone if they're starting a room within the Zone.

***With "Columns" there was the usual lack of random seeding, and again a rather drab color scheme for the lower number of colors. I also reduced the maximum number of colors by one, so that it would never use both of the indistinguishable grays. Also a comment on line 2840 mentioned a "Future animated splash screen", so I created one.

***The primary problem with "Chase" was lack of random seeding, so it always played the same sequence of games, which would wear out quickly. There were also a few duplicate line numbers I eliminated. The game presentation could also be improved by simply VTABbing up to display each new board layout over the old one, rather than scrolling up for new diagrams. Also, I documented in the instructions how a player should expect to encounter impossible situations frequently, and just move on when that happens; and I generally streamlined the code considerably, including cleaning up messy text displays.

***With "Gaussian distribution 2D", trying an example resulted in an "Illegal quantity in line 160". This was caused by the hires X coordinate just exceeding the maximum 279, apparently due to imprecise calculations. Reducing the designated maximum (assigned to 'w') in line 30 to a value of 278 seems to clear this up. I also reduced the maximum Y a bit so the diagram would not butt against the text on screen-line 21. In addition, there were a few (i.e. redundant) explicit expressions of the value of PI, all then multiplied by 2 to obtain 2PI; I replaced these with one derivation of PI/4 via ATN(1), multiplied by 8 to obtain 2PI, and stored it in variable 'p2' (for "PI * 2").

***With "Original Series Enterprise" I created a much more accurate depiction of said entity. To be honest, it really isn't Gil Keidar's anymore, it's mine...

***Finally, with "Prime Factors", the old version, in a number of cases, did not produce the correct results. I have fixed that problem. I also replaced its series of like multiplications (e.g. 2x2x2x2x2x2) with a base^exponent exprression (2^6).
2024-02-19 11:03:15 -08:00
Joshua Bell 7a42070bcd Add STRING$ and SPACE$ Demo (Alan Ratliff) 2024-02-19 10:35:04 -08:00
Joshua Bell 2fde77b8e8 correct attribution 2024-02-19 10:31:49 -08:00
Joshua Bell ea61e845c7 Add Sierpinski triangle by Helen Edgar 2024-02-19 10:26:21 -08:00
Joshua Bell d7ebf753db Thunderclock: Tweak DOS/BASIC handling of colons
This is ugly, but you should see what real BASIC/DOS do under the hood.
2024-02-11 15:16:39 -08:00
Joshua Bell d727640ef4 Added Random Maze sample by Alan Rat 2024-02-10 18:36:39 -08:00
Joshua Bell 555f8de2ae Simulate Thunderclock in Slot 4
See the new sample for details/example.

Note that reading 12/24-hour time formats that have colons will not
currently work, as the colons will terminate input and result in
invisible ?EXTRA IGNORED errors.

Fixes #44
2024-02-10 18:22:08 -08:00
Joshua Bell f18ad47d1c Samples: Update platformer, c/o Brendan Ghareeb 2024-01-13 10:18:34 -08:00
Joshua Bell 229f2957de Updated Platformer sample 2023-10-06 13:10:37 -07:00
Joshua Bell f625602942 Update platformer sample 2023-10-01 19:26:20 -07:00
Joshua Bell aee6b4665f Build sample index from data file 2023-03-10 20:24:57 -08:00
Joshua Bell 887b3be2a6 Updated Platformer sample by Beckett Bylsma 2023-03-08 08:45:01 -08:00
Joshua Bell 5ebbde151f Add platformer sample, a work in progress by Beckett Bylsma 2023-01-22 12:55:56 -08:00
Joshua Bell 7a8c663315 Further fixes for LEFT$/MID$/RIGHT$ and tests
* MID$ allows 0 for the second (length) argument
* Add tests for error cases.
2022-12-05 18:46:44 -08:00
Joshua Bell 252b39dc08 Add Bite sample 2022-10-23 15:25:37 -07:00
Joshua Bell 1d8e8822db Add Artillery sample 2022-10-23 15:23:41 -07:00
Joshua Bell 734d953a3b Add Building sample 2022-10-23 15:12:48 -07:00
Joshua Bell ea4444ae49 Add Codabar Generator sample 2022-10-23 15:04:43 -07:00
Joshua Bell 4e5fc97a61 Fix bad line numbers in sample 2022-09-06 19:32:06 -07:00
Mikael O. Bonnier 6ba216c726
Add Aritm game (#42)
* Create sample.aritm.txt

* Update index.html

* Added "01", ",1", and ".1" as alternatives to "-1"

* Updated year to 2022

* Initialze text mode & fix possible roundoff error

* Switched subroutines to functions & improved seed
2022-01-29 10:35:03 -08:00
Joshua Bell b75c1f027f Unit Tests: Fix TEXT, add failing FOR case 2021-03-31 20:28:41 -07:00
Joshua Bell 2495381bcb Fix parsing of unterminated strings in DATA statements
Fixes #35
2020-06-24 21:42:10 -07:00
Joshua Bell 697ccd63e9 Fix window text bottom - should not be changed if top changes.
The TTY module stores top/height but the Apple monitor stores
top/bottom. If top changes, bottom should remain unchanged.

Improve the POKE 34 shim, and add a test.
2020-06-24 21:19:49 -07:00
Joshua Bell c64c10e5d2 Various game fixes and enhancements by Alan Ratliff 2020-06-20 15:49:59 -07:00
Joshua Bell 6c7f7e9eec Update some URLs 2020-06-20 15:36:17 -07:00
Joshua Bell dd01e4c9f1 Add sample: Space Attack by Alan Ratliff 2020-06-13 10:46:11 -07:00
Joshua Bell 17b0baf7e5 Add softswitch reads for display modes
Fixes #32

The RdAltChar (mousetext) is not accurate. Under Virtual II it seems
to always return true if the 80 column firmware is active, regardless
of which character set is active.
2020-05-29 21:55:32 -07:00
Joshua Bell 44e308f030 GR adjusts text window. Fixes #33
GR now adjusts the text window to the bottom four lines of the
display. A unit test is added to verify.
2020-05-29 20:57:57 -07:00
Joshua Bell dca4875d3d TAB()/SPC() should have implicit trailing ;
Also add docs.

Fixes #34
2020-05-29 20:41:22 -07:00
Joshua Bell af0a7eb886 Ensure COLOR= gives Illegal Quantity Error for > 255. Fixes #30 2020-05-03 21:04:36 -07:00
Joshua Bell b11acbe1fb fix truncated sample 2020-02-10 08:06:56 -08:00
Joshua Bell 50c9355172 Add a few more samples 2020-02-09 21:08:51 -08:00
Joshua Bell 18c88661ac Add a bunch of samples 2020-02-09 21:02:04 -08:00
Joshua Bell 6c42af4b39 More samples by Golden Child 2020-01-29 21:31:02 -08:00
Joshua Bell 77b7882b12 Add samples c/o Golden Child 2020-01-14 18:20:14 -08:00
Arthur Allen 4a27231196 Adding Columns and Tetris games using lores graphics. (#28)
* Applesoft Basic Columns Game

Columns Game using lores graphics.

* Update index.html

Added links to Tetris and Columns games
2019-12-09 19:24:55 -08:00
Chris Whong 157ebf7f96 add ninja turtle example (#26) 2019-01-02 19:12:59 -08:00
Joshua Bell 8de025a8d4 Update font refs to https 2018-08-15 21:55:00 -07:00
Joshua Bell c29683009c Add Door Detector game sample by Jeff 2018-08-01 18:41:15 -07:00
Joshua Bell d76e0c2d73 Added 'Snowflakes' sample 2017-08-27 18:47:08 -07:00
Joshua Bell 2518462b01 Updated sample 2016-12-06 23:35:54 -08:00
Joshua Bell 2db989212f Sample fix 2016-12-03 15:28:45 -08:00
Joshua Bell 2553fe88ea Add samples by Gregg Buntin 2016-12-03 11:21:04 -08:00
Joshua Bell 78428020d8 Invalid DOS commands should fail with Syntax Error. Resolves #13 2016-09-17 18:17:34 -07:00
Sigurður Sveinn Halldórsson d53e58db23 Fix ON GOTO and ON GOSUB - Should resolve #11 (#12)
* Fix ON GOTO and ON GOSUB - Should resolve #11

* Fix ON GOTO and ON GOSUB better - Should handle edge cases

* Fix ON GOTO and ON GOSUB - Added unit tests

* Fix ON GOTO and ON GOSUB - Fixed unit tests
2016-07-25 19:14:33 -07:00
Joshua Bell 20f302339f Fix ONERR GOTO handling - should skip to next line. Resolves #7 2015-12-06 15:47:15 -08:00
Joshua Bell 2e27cda07b Added test for hook precedence 2015-11-25 19:07:39 -08:00
Joshua Bell f55aa51023 Make line numbers relevant; resolves issue #5 2014-12-28 20:55:23 -07:00
Joshua Bell 7a01309073 Implement CALL-3288; resolves #8 2014-12-27 17:51:21 -07:00
Joshua Bell 20d03b70fb New samples, updated docs 2013-08-18 21:26:39 -07:00