The worlds created on the LivingComputers minecraft server have boundaries. One may go from -1024 to 1023 in both directions.
If one gets outside the boundary, one may not move. And if one is far enough outside the boundary, one suffocates in a wall.
There are 2 methods to get outside the boundary: transport there (if you have that permission), and dismount from transportation. Getting off a boat or a minecart may put you outside the boundary. If the boat or minecart are still in position, you may remount it, and reenter the world.
Villagers may not pass through the boundary. However, it is possible to trade across it.
Water passes through the boundary.
Arrows pass through the boundary.
Trees grow through the boundary.
I believe when blocks are destroyed, their remains may end up across the boundary. I believe if you get close enough you can capture it.
I have yet to observe monsters across a boundary, and I suspect I can be shot, but I don’t know if a creeper can blow me up. (I’m not sure I want to find out).
Dynamite will destroy blocks across the boundary. Water may be poured across the boundary (and fetched.) A creeper blowing up on my side of the boundary did not seem to destroy blocks across it.
Using setBlock() to place blocks requires some attention.
Blocks are placed at Integer locations. You may pass a floating point value to the function, but it is converted to integer.
It is the converting to integer which may aggravate you:
The function int(x + dx) does not necessarily return the same value as int(x) + int(dx). If you are placing blocks around the origin (0,y,0), any -1 > dx < 1 will be truncated to 0. However, away from the origin, say x = 14, x – 0.5 will go to 13, where x + 0.5 will go to 14.
I assume your x and z will be integers already, so make dx and dz integers before you add them to x and z.
setBlock(x+int(dx), y, z+int(dz), 0)
Well, not quite.
It appears the memory can be read, but it also looks like it is not being restored/written.
See how the Yellow trace and the Blue trace ~almost~ are high together? Well, IF they were both high together then the memory is supposed to write.
Alas, sometimes things just don’t go smoothly.
Ouch, and that was an original too.
So, this is how we restore it:
Punching cards by hand… Notice the purple stripe at the top? Must be an imposter! (plus I put a datecode on the back)
Okay, if the Apple 1 computer does not have screen addressing, how am I doing SPIROGRAPH?
7000 REM SET PIXEL (X, Y) 0-39, 0-47
7010 Z = 1 : Q = V(10*(Y/2)+X/4+1) * 2
7020 FOR S = 1 TO 4 – X MOD 4
7030 Z = Z * 4: Q = Q / 4
7040 NEXT S
7050 Q = Q MOD 4: Z = Z / 4
7060 IF Y MOD 2 = 0 THEN 7080
7070 IF Q MOD 4 = 0 THEN V(10*(Y/2)+X/4+1) = V(10*(Y/2)+X/4+1) + Z: RETURN
7080 IF Q MOD 4 = 0 THEN V(10*(Y/2)+X/4+1) = V(10*(Y/2)+X/4+1) + Z * 2: RETURN
8000 REM PRINT SCREEN 40 * 48; TBTBTBTB
8010 FOR Y = 0 TO 23
8020 FOR X = 0 TO 39
8030 IF Y = 23 AND X = 39 THEN RETURN
8040 Z = V(Y * 10 + X / 4 + 1) * 4
8050 FOR S = 1 TO 4 – X MOD 4
8060 Z = Z / 4
8070 NEXT S
8080 Z = Z MOD 4
8090 IF Z = 3 THEN PRINT “:”;
8100 IF Z = 2 THEN PRINT “‘”;
8110 IF Z = 1 THEN PRINT “,”;
8120 IF Z = 0 THEN PRINT ” “;
8130 NEXT X
8140 NEXT Y
As the screen is 40 x 24 characters, it would be nice to make that 40 x 48 — using ‘ , and : to double vertical resolution.
First I made an array of 240 integers. It would have been nice to make an array of 40 x 48 integers, but there isn’t enough memory, and two dimensional arrays are not supported. So I had to fit two vertical dots and 4 horizontal dots into one integer. Then, using shift-by-divide and the MOD function, I could calculate what I wanted on the screen, and finally print it all out at once. However, I didn’t print out the last character, as that would have scrolled the screen.
Spirograph is round, so the 48 lines vertically are not needed. And, this is important, because the program actually loads, but does not run — getting an out-of-memory error. Deleting some of the many REMarks frees up enough space to run.
If the Apple 1 computer came with INTEGER BASIC, then how am I doing BIORHYTHM?
9000 REM SIN/COS (DEGREES) INPUT A, OUTPUTS S, C
9010 S = ((A MOD 360)+360) MOD 360: REM GET ANGLE 0-359
9020 IF S < 180 THEN 9060
9030 IF S < 270 THEN 9050
9040 C = C5(S-270+1): S =-C5(360-S+1): RETURN: REM 270-359
9050 C =-C5(270-S+1): S =-C5(S-180+1): RETURN: REM 180-269
9060 IF S < 90 THEN 9080
9070 C =-C5(S-90+1): S = C5(180-S+1): RETURN: REM 90-179
9080 C = C5(90-S+1): S = C5(S+1): RETURN: REM 0-089
9800 REM SET UP TABLE
9810 DIM C5(91)
9820 S=0: C=8192
9830 FOR A = 0 TO 45
9840 C5(A+1) = S: C5(90-A+1) = C
9870 NEXT A
First I set up an array to hold SIN for 0 to 90 degrees. (You don’t need more if you know COS is SIN of the angle plus 90, and other quadrants are symmetrical).
But, creating an array of 91 values would pretty much take up all of available programming space, so I generated it using the differential equations — relating SIN and COS. I also made the values go from 0 to 8192, as going from 0 to 1 is not useful.
INTEGER BASIC for the Apple 1 computer is not well documented.
Here are some things I found:
A FOR loop will always execute at least once. This is unlike most BASIC machines, which will not execute the innards of FOR I = 1 TO 0.
Although the exponentiation symbol is recognized (^), don’t use it — that is a lock-up condition.
IF statements will execute a command. However, multiple commands on the same line are not contained within the IF result. That is, IF X > Y THEN A = 0: GOTO 1230 will always go to 1230.
This is our Logo. See how it is an isometric view of an angular robot hand? Well, it sure looks like it started that way.
My initial goal was to convert this image into a descriptions of lines so that we could create a logo for our printed circuit boards. It should have been easy: line from a to b, circle at x, y with radius r, etc. But, those black lines you see in that picture are not actually black lines. They are areas defined by zero-width line edges. Finding accurate endpoints for those lines was annoying.
So, I quickly thought it may be easier to re-create a 3D model and then project those edges to a 2D plane. That was not easy, yet, perhaps, it may have been easier than the original goal.
Now we have a 3D model of the robot hand, plus a projection to a 2D plane.
This line drawing is scalable in an Excel spreadsheet, and creates a Script file to use in Eagle PCB layout.
This is the bonus: