Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Pete

Pages: 1 2 [3] 4 5 ... 158
31
Programs / Re: Double Pendulum Studies
« on: March 19, 2022, 10:53:19 am »
Ah, hold on there sparky, the "Press any key for next case." is broken. Any key pressed results in an exit. Now the first example works as expected. The modification to the effect, however, is quite impressive. This is probably just a small glitch in the transformation process. Wish I could understand the math. It's a bit over my head, but it sure feels nice.

Pete

32
Quote from bplus: "0 the one mode you can read characters from, a point for Pete ;-))"

Yep, SCREEN 0 rules! Back in good old QBasic days, I used to place data on the screen in color 0, 0, at the end of one program, and then used RUN to start a new, related program. The new program would read the data from the screen, clear the screen, and use the data to determine the actions of the program. I never used CHAIN. I think it might be racist! :D

Pete

33
Couldn't leaf well enough alone, could you?

Pete

34
Programs / Re: QBJS - QBasic for the Web
« on: March 16, 2022, 10:19:23 pm »
Man, this is just so amazing. Galleon intended to bring QB64 into the web with a javascript core one day™️, you just went ahead and did it yourself. The integration blows my mind, with parameters going back and forth between basic code and javascript. You are on fire, man. 🔥

Yep. one down, one to go on that wish list of his, JAVA. Rob wanted to redo QB64 in JAVA, so it could be used to make mobile apps for Android devices. Honestly for the time, circa 2007, C/C++ seemed to be the most stable choice, and PCs and laptops were in the user majority. JAVA would have satisfied both, and can be run on Apple and Linux too, but I guess a couple JAVA versions were blocked by Apple in the past.

Oh, and a post for history sake: https://www.tapatalk.com/groups/qbasic/welcome-to-the-qb64-forum-t36432.html#p158976 

35
Programs / Re: Eye Candy
« on: March 08, 2022, 10:50:09 pm »
Ha ha, an animated un-animated png! Nice optical illusion.

Pete

36
Programs / Re: Mystical rooms, collect the diamonds!
« on: March 07, 2022, 10:45:11 pm »
... but you can check out anytime you like.

 - Hotel California

37
Programs / Re: Mystical rooms, collect the diamonds!
« on: March 07, 2022, 05:37:21 pm »
I did find a door, but couldn't get to it. Oh well, I never play games, so that didn't surprise me. Not being above to use the esc key to end did surprise me, so I had to do an ALT+Tab and "x" click to end it.

Pretty amazing to see how a map engine works. Lots of math instead of lots of code.

Pete

38
Programs / Re: Eye Candy
« on: March 07, 2022, 05:18:55 pm »
My eyes! My eyes! I have lost the ability to blink! Oh the humanity!  lol

Me too, but thanks to Mark, I can now add "BLIND" to my list of tax deductions!

Pete

39
Programs / Re: Evolving RI (Robot Intelligence) for a room vacuum
« on: March 04, 2022, 11:06:18 pm »
I wrote an AI code to make a robot vacuum a room, but I overdid it, and it cost me a fortune. It hired a maid.

Pete

40
Programs / Re: Map Projections (of the Earth): Any Experts?
« on: February 26, 2022, 10:30:56 pm »
I figured something went wrong with downloading both zips. I removed both, and only downloaded the #11 zip, and it worked for me, too. Wooohooo!

Very impressive.

Pete

41
Programs / Re: Map Projections (of the Earth): Any Experts?
« on: February 26, 2022, 07:58:30 pm »
Un-B-Plusing-lievable!

What is the outline-world-map.jpg used for? I see it has the country borders, but when I downloaded the "fixed" version and ran it, I still got the borderless countries display. I tried swapping out map.png with outline-world-map.jpg but no bueno.

Pete

42
Programs / Re: Ray Trace a translation from SpecBAS
« on: February 26, 2022, 03:19:44 pm »
Oh balls!

or... Oh balls, there's a bunch of GOTO statements in the translation. Hmmm, let's see. How about...

Code: QB64: [Select]
  1. _TITLE "RayTrace" 'b+ trans from JB to QB64 2022-02-26
  2. CONST scrw = 1024, scrh = 680
  3. SCREEN _NEWIMAGE(scrw, scrh, 32)
  4. _SCREENMOVE 150, 40
  5. READ spheres
  6. DIM c(spheres, 3), r(spheres), q(spheres), cl(4) AS _UNSIGNED LONG
  7. w = scrw / 2
  8. h = scrh / 2
  9. s = 0
  10. cl(1) = _RGB32(120, 65, 45) ' shaddow
  11. cl(2) = _RGB32(0, 0, 100)
  12. cl(3) = _RGB32(255, 255, 0)
  13. cl(4) = _RGB32(0, 0, 200)
  14. FOR k = 1 TO spheres
  15.     READ a, b, c, d
  16.     c(k, 1) = a
  17.     c(k, 2) = b
  18.     c(k, 3) = c
  19.     r = d
  20.     r(k) = r
  21.     q(k) = r * r
  22.  
  23. FOR i = 1 TO scrh
  24.     FOR j = 0 TO scrw - 1
  25.         x = 0.3: y = -0.5: z = 0: ba = 3
  26.         dx = j - w: dy = h - i: dz = (scrh / 480) * 600
  27.         dd = dx * dx + dy * dy + dz * dz
  28.         DO
  29.             n = (y >= 0 OR dy <= 0) '* -1   <<< Makes $1000 for knowing where to tap the hammer
  30.             IF n = 0 THEN s = (y / dy) * -1
  31.             FOR k = 1 TO spheres
  32.                 px = c(k, 1) - x: py = c(k, 2) - y: pz = c(k, 3) - z
  33.                 pp = px * px + py * py + pz * pz
  34.                 sc = px * dx + py * dy + pz * dz
  35.                 IF sc > 0 THEN
  36.                     bb = sc * sc / dd
  37.                     aa = q(k) - pp + bb
  38.                     IF aa > 0 THEN
  39.                         sc = (SQR(bb) - SQR(aa)) / SQR(dd)
  40.                         IF sc < s OR n < 0 THEN n = k: s = sc
  41.                     END IF
  42.                 END IF
  43.             NEXT k
  44.             IF n < 0 THEN
  45.                 PSET (j, scrh - i), _RGB32(128 * (scrh - i) / scrh + 128 * (dy * dy / dd), 128 * (scrh - i) / scrh + 128 * (dy * dy / dd), 200 + 55 * (dy * dy / dd))
  46.                 EXIT DO
  47.             ELSE
  48.                 dx = dx * s: dy = dy * s: dz = dz * s: dd = dd * s * s
  49.                 x = x + dx: y = y + dy: z = z + dz
  50.                 IF n <> 0 THEN
  51.                     nx = x - c(n, 1): ny = y - c(n, 2): nz = z - c(n, 3)
  52.                     nn = nx * nx + ny * ny + nz * nz
  53.                     l = 2 * (dx * nx + dy * ny + dz * nz) / nn
  54.                     dx = dx - nx * l: dy = dy - ny * l: dz = dz - nz * l
  55.                 ELSE
  56.                     FOR k = 1 TO spheres
  57.                         u = c(k, 1) - x
  58.                         v = c(k, 3) - z
  59.                         IF u * u + v * v <= q(k) THEN ba = 1: EXIT FOR
  60.                     NEXT k
  61.                     IF (x - INT(x) > .5) = (z - INT(z) > .5) THEN
  62.                         PSET (j, scrh - i), cl(ba)
  63.                     ELSE
  64.                         PSET (j, scrh - i), cl(ba + 1)
  65.                     END IF
  66.                     EXIT DO
  67.                 END IF
  68.             END IF
  69.         LOOP
  70.     NEXT j
  71.  
  72. DATA -0.3,-0.8,3,0.6
  73. DATA 0.9,-1.4,3.5,0.35
  74. DATA 0.7,-0.45,2.5,0.4
  75. DATA -0.5,-0.3,1.5,0.15
  76. DATA 1.0,-0.2,1.5,0.1
  77. DATA -0.1,-0.2,1.25,0.2
  78.  

Looks cool though. Thanks for the heavy lifting!

Pete

43
Like Steve mentioned, it's just missing _AUTODISPALY.

    INPUT "PRESS <ENTER> TO CONTINUE"; in$
    _AUTODISPLAY
END SUB   

Pete

44
QB64 Discussion / Re: GotBasic - QB64 Mention
« on: February 26, 2022, 01:14:06 pm »
I'm also in the process of a project that could get listed called Basic Engineered Nano Technology. It's a way to communicate with atoms, on the molecular level. It sends program commands to a 3-D printer, so users can _PRINTSTRING, _PRINTROPE, or even _PRINTCANDLES. (Note: If you enjoy the scented ones, sorry, you need FreeBASIC for that.)

So while GotBASIC is a catchy name and neat website, I urge you all to wait for my new product release, coming this fall, when I can tell everyone in the programming community to Get BENT!

Pete

45
QB64 Discussion / Re: Problem with OPEN in SUB
« on: February 26, 2022, 01:00:09 pm »
@Cobalt makes a good point.

Personally I find the use of UDT's useful for large apps with many parameter to pass to many subs. It saves a ton of typing and dramatically reduces line sizes. For smaller apps or non-sub snippets, I tend not to use them. I suppose some people, in either case, may prefer UDT's for better variable naming, especially grouping of variable names to assignments.

Pete

Pages: 1 2 [3] 4 5 ... 158