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 - Qbee

Pages: [1] 2
1
Programs / Re: QB64-SDL 2020
« on: January 09, 2020, 10:08:00 am »
Cleaned up some more of the code to remove further references to the old SDL update procedure.  Back in the day, SDL used to call up [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there], see if a newer version of itself existed, and then, if so, upgrade itself for us.  Now, however, [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there] is a hacker's site -- Galleon no longer maintains it and nobody knows who the crap registered it and put it back up on the net -- so it's not a place that one wants to visit ever.  Going there isn't going to update crap -- it'll just lock up the update process as it freezes waiting for a non-existent response to come back to it -- and there's no reason to give that bogus site your IP address, or anything else.
If it is so, then
a) the complete wiki should be searched for links to that site and those links removed; I had one some days/weeks ago
b) this complete Forum should be searched for links to that site and those links removed; I am sure, I saw some links to that site in this forum

To know here are links to hacker-site(s) is no good feeling.

2
QB64 Discussion / Re: QB64 Oddness at Work
« on: January 08, 2020, 12:05:24 pm »
Watching the results made me think of "Weird Scenes Inside the Goldmine".
Long forgotten ... thank you for make me think of that.
Couldn't resist - went into the city and bought it - AGAIN.

3
QB64 Discussion / Re: QB64 Oddness at Work
« on: January 08, 2020, 07:48:08 am »
Watching the results made me think of "Weird Scenes Inside the Goldmine".
Long forgotten ... thank you for make me think of that.

4
Programs / Re: Northern Lights
« on: January 06, 2020, 04:27:32 pm »
I use GIF Movie Gear (Full version).
It is a little bit old, supports Windows XP, but works fine with Windows 10.

5
Programs / Re: Northern Lights
« on: January 06, 2020, 04:02:31 pm »
Aurora and Ribbon Candy by rfrost@mail.com and Aurora-Mod by bplus look all interesting.

To show guests, who otherwise have to imagine the beauty directly from code,  I made a very short (a few seconds, but still takes nearly 14 MB after reducing from 74 MB) GIF-Animation from the Aurora-Mod.


6
Programs / Re: Hello physics
« on: January 05, 2020, 07:46:42 pm »
Time to add some bit more advanced features. Ball-rim collisions would be nice, but it also means giving up my original code minimalism idea. Never mind, I think it is woth it.
What do you think:

Was fun :)

I added "a$ = INKEY$" as last line to make a screenshot: 10 Points isn't bad, or ?


7
The 4th in the USA means the forth of July unless you are an obsessive Star Wars fan, then it means "may the forth be with you" :D
Ah, ok, thanks for clearing.

8
"Duration": Mostly the Fireworks are replaced by others too fast, in my opinion. The fireworks have not enough time to "burn down". These times should be longer, but accordiing to the actual firework.

"Replacements": It looks like the fireworks can't "burn down", because they are replaced by new fireworks. This is too obvious, I think. I assume the array for "active" fireworks is to small, so that new fireworks replaces older ones, even if they only started a short time before.

"next year or the 4th" means next year or in 4 years? I am sure I misunderstand what it really means.

[ways of] 3D-spheres sounds interesting, too.


9
How do you top 2018's code show?

That is really a nice show!
How to top that? Only by improving, for instance:
- fullscreen (to fit my 1024px-Screen that I need for my old blue eyes)
- keyhit to escape from program
- gravity
- duration
- replacements
- some kind of parallax effects (i. e. moving visitors (?) )
- sound (yes! bombastic firework sound and pathetic music)

Great also the mirroring of the fireworks.

I am glad to have another year to do my very best :)
And thanks, @bplus, for sharing (again) :)

10
QB64 Discussion / Re: _SCREENPRINT for Mouse ?
« on: January 03, 2020, 06:49:35 am »
Thank you, @RhoSigma . That will help.

11
QB64 Discussion / _SCREENPRINT for Mouse ?
« on: January 03, 2020, 05:49:36 am »
Hello,

in the wiki I found some codes with which text can be entered in an external program, i. e. notepad, using _SCREENPRINT.

Moving the mouse in the local program works using _MOUSEMOVE.
What I try is
- to get the mouse position from outside the local program and
- to move the mouse in (and send mouse clicks to) an external program.

Is there a way to do that ?

12
Programs / Re: Pathfinder
« on: December 18, 2019, 08:41:41 pm »
That is pretty cool!

Alas, I have started to reinvent the wheel. Now I have something to compare my experiments with. Thanks!

13
Programs / Re: Pathfinder
« on: December 18, 2019, 11:27:18 am »
Ok.
So needs 2 tasks:
- code for creating mazes
- code for running the mazes

14
Programs / Re: Pathfinder
« on: December 18, 2019, 07:30:35 am »
Attached it to the post.

15
Programs / Pathfinder
« on: December 18, 2019, 06:30:22 am »
Hello,

I managed to create a pathfinding tool, named "Pathfinder 1.0 for QB64v1.3", that finds a path from point A to point B, if there is a path. If no path exists, the tool will recognize that and give a message. Otherwise the path is shown on the map.
Actually the map has a size of 100 x 100 fields on a 800 x 600 pixel screen. The values can (slightly?)  be changed to test on others mapsizes; calculations are installed in that way that they can handle variable parameters.
It's far from beeing optimal, but at least it does it's job :)

Animated GIF (Thumb)

Code: QB64: [Select]
  1. '$include:'CONSTANTS_Color.BI'
  2. _TITLE "Pathfinder v1.0 for QB64v1.3"
  3. ' done 2019-12-17 to 2019-12-18
  4. ' by Myself (Karsten Maske)
  5. '
  6. ' ESC to exit program
  7. ' any other key restarts with creating a new random map
  8. '
  9.  
  10. CONST SW = 800
  11. CONST SH = 600
  12. CONST MAPWIDTH = 100 ' 100 on 800 * 600 => 8 pixel width
  13. CONST MAPHEIGHT = 100 ' 100 on 800 * 600 => 6 pixel height
  14. CONST MINX = 1
  15. CONST MAXX = MAPWIDTH
  16. CONST MINY = 1
  17. CONST MAXY = MAPHEIGHT
  18. CONST SQUAREWIDTH = SW / MAPWIDTH
  19. CONST SQUAREHEIGHT = SH / MAPHEIGHT
  20. CONST COST = 1 ' move cost from one square to another; horizontal/vertical = diagonal
  21. CONST YOUSHALLNOTPASS = 32000 ' !! signed integer, stay within positive values
  22.  
  23. TYPE typeNode
  24.     id AS INTEGER ' calculated as y * MAPWIDTH + x
  25.     x AS INTEGER
  26.     y AS INTEGER
  27.     f AS SINGLE '   f(x) = g(x) + c + h(x)
  28.     p AS INTEGER '  previous Node (nodeID)
  29.     oo AS INTEGER ' 1 = on OpenList
  30.     oc AS INTEGER ' 1 = on ClosedList
  31.  
  32. DIM SHARED Nodes(0 TO (MAXY - MINY) * MAPWIDTH + (MAXX - MINX)) AS typeNode
  33. DIM SHARED Map(MINX TO MAXX, MINY TO MAXY) AS INTEGER
  34. DIM SHARED bPathFound AS INTEGER
  35. DIM SHARED bNoPathFound AS INTEGER
  36.  
  37. ' #############################################################################################################
  38. ' <- Definitions
  39. ' -> Initialization
  40. ' #############################################################################################################
  41.  
  42. SCREEN _NEWIMAGE(SW, SH, 32)
  43.  
  44.     CLS
  45.  
  46.     bPathFound = 0
  47.     bNoPathFound = 0
  48.     startX = 6
  49.     startY = MAPHEIGHT - 6
  50.     endX = MAPWIDTH - 6
  51.     endY = 6
  52.  
  53.     InitNodes
  54.     InitMap
  55.     SetWall INT(MAPWIDTH / 2), INT(MAPHEIGHT / 4), INT(MAPWIDTH / 2) + 1, MAPHEIGHT - 5
  56.     SetWall INT(MAPWIDTH / 2) + 1, MAPHEIGHT - 6, INT(MAPWIDTH / 3), MAPHEIGHT - 7
  57.     FOR id = 1 TO 250
  58.         RandomBlock
  59.     NEXT
  60.     PaintMap
  61.     ShowCrow
  62.  
  63.     endID = GetIdFromXY(endX, endY)
  64.     id = GetIdFromXY(startX, startY)
  65.     startID = id
  66.     Nodes(id).x = startX
  67.     Nodes(id).y = startY
  68.     Nodes(id).id = id
  69.     Nodes(id).f = SQR(((startX - endX) ^ 2) + ((startY - endY) ^ 2)) ' only h(x)
  70.     Nodes(id).p = 0
  71.     Nodes(id).oo = 1 ' put on open list
  72.     Nodes(id).oc = 0
  73.  
  74.     ' #############################################################################################################
  75.     ' <- Initialization
  76.     ' -> Main
  77.     ' #############################################################################################################
  78.  
  79.     DO
  80.         _LIMIT 1000
  81.         GetNeighbours
  82.  
  83.     LOOP WHILE (bPathFound = 0) AND (bNoPathFound = 0)
  84.  
  85.     LOCATE 1, 1
  86.     IF bPathFound = 1 THEN
  87.         PRINT "Path found!"
  88.         ShowPath
  89.     ELSEIF bNoPathFound = 1 THEN
  90.         PRINT "No path found!"
  91.     ELSE
  92.         PRINT "Nothing"
  93.     END IF
  94.  
  95.     DO
  96.         a = INKEY$
  97.     LOOP WHILE a = ""
  98.  
  99. LOOP WHILE a <> CHR$(27)
  100.  
  101. ' #############################################################################################################
  102. ' <- Main
  103. ' -> helper
  104. ' #############################################################################################################
  105.  
  106. FUNCTION GetIdFromXY (x AS INTEGER, y AS INTEGER)
  107.     GetIdFromXY = (y - MINY) * MAPWIDTH + (x - MINX)
  108.  
  109. ' #############################################################################################################
  110. ' <- helper
  111. ' -> pathfinding SUBs
  112. ' #############################################################################################################
  113.  
  114. SUB GetNeighbours
  115.  
  116.     DIM x AS INTEGER, y AS INTEGER, x1 AS INTEGER, y1 AS INTEGER
  117.     DIM id AS INTEGER
  118.     DIM ooid AS INTEGER
  119.     DIM f AS SINGLE
  120.  
  121.     ooid = GetMinFromOpenList
  122.     IF ooid = 0 THEN ' nothing on open list
  123.         bNoPathFound = 1
  124.         EXIT SUB
  125.     END IF
  126.  
  127.     x1 = Nodes(ooid).x
  128.     y1 = Nodes(ooid).y
  129.  
  130.     IF ooid <> startID THEN
  131.         PaintBlock ooid, GOLD
  132.     END IF
  133.  
  134.     FOR y = y1 - 1 TO y1 + 1 STEP 1
  135.         IF y >= MINY AND y <= MAXY THEN
  136.             FOR x = x1 - 1 TO x1 + 1 STEP 1
  137.                 IF x >= MINX AND x <= MAXX THEN
  138.                     id = GetIdFromXY(x, y)
  139.                     IF id <> startID THEN
  140.                         IF Nodes(id).oc = 0 THEN ' not yet on closed list
  141.                             IF id <> startID THEN
  142.                                 PaintBlock id, AQUA
  143.                             END IF
  144.                             f = Nodes(ooid).f + Map(x, y) + SQR(((x - endX) ^ 2) + ((y - endY) ^ 2))
  145.                             IF id <> endID THEN
  146.                                 IF Nodes(id).oo THEN ' is on open list
  147.                                     IF Nodes(id).f > f THEN
  148.                                         Nodes(id).p = Nodes(ooid).id
  149.                                         Nodes(id).f = f
  150.                                     END IF
  151.                                 ELSE ' not yet on open list
  152.                                     Nodes(id).f = f
  153.                                     Nodes(id).p = Nodes(ooid).id
  154.                                     Nodes(id).oo = 1 ' put on open list
  155.                                     IF id <> startID THEN
  156.                                         PaintBlock id, DARKORANGE
  157.                                     END IF
  158.                                 END IF
  159.                             ELSE
  160.                                 Nodes(id).p = Nodes(ooid).id
  161.                                 bPathFound = 1
  162.                                 EXIT SUB
  163.                             END IF
  164.                         ELSE
  165.                             IF id <> startID THEN
  166.                                 PaintBlock id, GRAY
  167.                             END IF
  168.                         END IF
  169.                     END IF
  170.                 END IF
  171.             NEXT
  172.         END IF
  173.     NEXT
  174.  
  175.     Nodes(ooid).oc = 1
  176.     Nodes(ooid).oo = 0
  177.     IF ooid <> startID THEN
  178.         PaintBlock ooid, BLACK 'SILVER
  179.     END IF
  180.  
  181. FUNCTION GetMinFromOpenList% ()
  182.     DIM i AS INTEGER, id AS INTEGER
  183.     DIM minf AS SINGLE
  184.  
  185.     minf = 99999.9
  186.     id = 0
  187.  
  188.     FOR i = 0 TO MAXX * MAXY - 1
  189.         IF Nodes(i).oo = 1 THEN
  190.             IF Nodes(i).f > 0 THEN
  191.                 IF Nodes(i).f < minf THEN
  192.                     minf = Nodes(i).f
  193.                     id = i
  194.                 END IF
  195.             END IF
  196.         END IF
  197.     NEXT
  198.     GetMinFromOpenList = id
  199.  
  200.  
  201. SUB InitNodes
  202.     DIM x AS INTEGER, y AS INTEGER, id AS INTEGER
  203.  
  204.     FOR y = MINY TO MAXY
  205.         FOR x = MINX TO MAXX
  206.             id = GetIdFromXY(x, y)
  207.             Nodes(id).id = id
  208.             Nodes(id).x = x
  209.             Nodes(id).y = y
  210.             Nodes(id).f = 0
  211.             Nodes(id).p = 0
  212.             Nodes(id).oo = 0
  213.             Nodes(id).oc = 0
  214.         NEXT
  215.     NEXT
  216.  
  217.  
  218. ' #############################################################################################################
  219. ' <- pathfinding SUBs
  220. ' -> map related non graphical Subs
  221. ' #############################################################################################################
  222.  
  223. SUB InitMap
  224.     DIM x AS INTEGER, x1 AS INTEGER, x2 AS INTEGER
  225.     DIM y AS INTEGER, y1 AS INTEGER, y2 AS INTEGER
  226.  
  227.     FOR y = MINY TO MAXY
  228.         y1 = (y - MINY) * SQUAREHEIGHT
  229.         y2 = y1 + SQUAREHEIGHT - 1
  230.         FOR x = MINX TO MAXX
  231.             Map(x, y) = 1
  232.             x1 = (x - MINX) * SQUAREWIDTH
  233.             x2 = x1 + SQUAREWIDTH - 1
  234.         NEXT
  235.     NEXT
  236.  
  237.  
  238. SUB SetWall (x1, y1, x2, y2)
  239.     DIM x AS INTEGER, y AS INTEGER
  240.  
  241.     IF x1 > x2 THEN
  242.         x = x1
  243.         x1 = x2
  244.         x2 = x
  245.     END IF
  246.  
  247.     IF y1 > y2 THEN
  248.         y = y1
  249.         y1 = y2
  250.         y2 = y
  251.     END IF
  252.  
  253.  
  254.     FOR y = y1 TO y2
  255.         FOR x = x1 TO x2
  256.             Map(x, y) = YOUSHALLNOTPASS
  257.         NEXT
  258.     NEXT
  259.  
  260. SUB RandomBlock
  261.     DIM x1 AS INTEGER, y1 AS INTEGER, x2 AS INTEGER, y2 AS INTEGER
  262.     DIM n AS INTEGER
  263.  
  264.     n = INT(RND * 5) + 1
  265.     x1 = INT(RND * (MAPWIDTH - n - 2)) + 1
  266.     x2 = x1 + n - 1
  267.  
  268.     n = INT(RND * 5) + 1
  269.     y1 = INT(RND * (MAPHEIGHT - n - 2)) + 1
  270.     y2 = y1 + n - 1
  271.  
  272.     SetWall x1, y1, x2, y2
  273.  
  274.  
  275. ' #############################################################################################################
  276. ' <- map related non graphical Subs
  277. ' -> map related graphical Subs
  278. ' #############################################################################################################
  279.  
  280. SUB PaintMap
  281.     DIM x AS INTEGER, x1 AS INTEGER, x2 AS INTEGER
  282.     DIM y AS INTEGER, y1 AS INTEGER, y2 AS INTEGER
  283.     DIM col AS LONG
  284.  
  285.     CLS
  286.     FOR y = MINY TO MAXY
  287.         y1 = (y - MINY) * SQUAREHEIGHT
  288.         y2 = y1 + SQUAREHEIGHT - 1
  289.         FOR x = MINX TO MAXX
  290.             x1 = (x - MINX) * SQUAREWIDTH
  291.             x2 = x1 + SQUAREWIDTH - 1
  292.             IF Map(x, y) < YOUSHALLNOTPASS THEN
  293.                 col = FERN
  294.             ELSE
  295.                 col = BLACK
  296.             END IF
  297.             LINE (x1, y1)-(x2, y2), col, BF
  298.             LINE (x1, y1)-(x2, y2), BLACK, B
  299.         NEXT
  300.     NEXT
  301.  
  302.     PlaceStartEnd startX, startY, MAROON
  303.     PlaceStartEnd endX, endY, LAWNGREEN
  304.  
  305.  
  306. SUB PlaceStartEnd (x AS INTEGER, y AS INTEGER, col AS LONG)
  307.     DIM x1 AS INTEGER, x2 AS INTEGER, y1 AS INTEGER, y2 AS INTEGER
  308.  
  309.     x1 = (x - MINX) * SQUAREWIDTH
  310.     x2 = x1 + SQUAREWIDTH - 1
  311.     y1 = (y - MINY) * SQUAREHEIGHT
  312.     y2 = y1 + SQUAREHEIGHT - 1
  313.     LINE (x1, y1)-(x2, y2), col, BF
  314.  
  315.  
  316. SUB ShowCrow
  317.     LINE ((startX - MINX) * SQUAREWIDTH, (startY - MINY) * SQUAREHEIGHT)-((endX - MINX) * SQUAREWIDTH, (endY - MINY) * SQUAREHEIGHT), WHITE
  318.  
  319. SUB ShowPath
  320.     DIM x AS INTEGER, x1 AS INTEGER, x2 AS INTEGER
  321.     DIM y AS INTEGER, y1 AS INTEGER, y2 AS INTEGER
  322.     DIM id AS INTEGER, zid AS INTEGER
  323.  
  324.     PaintMap
  325.  
  326.     zid = GetIdFromXY(startX, startY)
  327.     id = GetIdFromXY(endX, endY)
  328.  
  329.     IF Nodes(id).p THEN
  330.  
  331.         WHILE id <> zid
  332.             x = Nodes(Nodes(id).p).x
  333.             y = Nodes(Nodes(id).p).y
  334.             y1 = (y - MINY) * SQUAREHEIGHT
  335.             y2 = y1 + SQUAREHEIGHT - 1
  336.             x1 = (x - MINX) * SQUAREWIDTH
  337.             x2 = x1 + SQUAREWIDTH - 1
  338.  
  339.             LINE (x1, y1)-(x2, y2), CORNFLOWERBLUE, BF
  340.  
  341.             id = Nodes(id).p
  342.         WEND
  343.     END IF
  344.  
  345.     PlaceStartEnd startX, startY, MAROON
  346.     PlaceStartEnd endX, endY, LAWNGREEN
  347.  
  348.  
  349. SUB PaintBlock (id AS INTEGER, col AS LONG)
  350.     DIM x AS INTEGER, y AS INTEGER
  351.     DIM x1 AS INTEGER, y1 AS INTEGER, x2 AS INTEGER, y2 AS INTEGER
  352.  
  353.     x = Nodes(id).x
  354.     y = Nodes(id).y
  355.  
  356.     y1 = (y - MINY) * SQUAREHEIGHT
  357.     y2 = y1 + SQUAREHEIGHT - 1
  358.     x1 = (x - MINX) * SQUAREWIDTH
  359.     x2 = x1 + SQUAREWIDTH - 1
  360.  
  361.     LINE (x1, y1)-(x2, y2), col, BF
  362.  
  363.  


Pages: [1] 2