Author Topic: MasterGy is looking for ideas to implement ("i suffer")  (Read 14600 times)

0 Members and 1 Guest are viewing this topic.

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
MasterGy is looking for ideas to implement ("i suffer")
« on: March 04, 2021, 02:32:51 pm »
Hello ! I'm bored.
This program is like grabbing a pencil and scratching the paper. Idiocy, no sense. There is a lack of ideas

Code: QB64: [Select]
  1. monx = 600 'window size
  2. mony = 400
  3.  
  4. mon = _NEWIMAGE(monx, mony, 32): SCREEN mon
  5.  
  6.  
  7. actx = monx / 2 'start draw to middle
  8. acty = mony / 2
  9. add_zoom = .01 'the amount to be added to the position
  10. radius = 20 'how many degrees can you go?
  11. ang_min = -1 'how many degrees can there be a difference between the current and the new direction?
  12. ang_max = -ang_min
  13. cyc_min = 30 'how long do you do a new direction? (min)
  14. cyc_max = 100 ' (max)
  15.  
  16.  
  17. DO: _LIMIT 3000
  18.     DO
  19.         PSET (actx, acty)
  20.         IF cyc_counter <= 0 THEN
  21.             add_ang = (ang_min + (ang_max - ang_min) * RND(1)) * (forced_ang_max_up + 1)
  22.             cyc_counter = cyc_min + (cyc_max - cyc_min) * RND(1)
  23.         END IF
  24.  
  25.         try_act_ang = act_ang + add_ang
  26.         xang_norad = try_act_ang * (_PI / 180)
  27.         try_x = actx + SIN(xang_norad) * radius * add_zoom
  28.         try_y = acty + COS(xang_norad) * radius * add_zoom
  29.  
  30.         IF try_x < 0 OR try_x > monx - 1 OR try_y < 0 OR try_y > mony - 1 THEN cyc_counter = -1: forced_ang_max_up = forced_ang_max_up + 1
  31.  
  32.         IF cyc_counter > 0 THEN
  33.             forced_ang_max_up = 0
  34.             actx = try_x
  35.             acty = try_y
  36.             act_ang = try_act_ang
  37.         END IF
  38.  
  39.         cyc_counter = cyc_counter - 1
  40.  
  41.     LOOP WHILE forced_ang_max_up
« Last Edit: March 29, 2021, 12:04:37 pm by odin »

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: i suffer
« Reply #1 on: March 04, 2021, 02:39:42 pm »
I deal with night watch. there are road constructions in Hungary. highways, overpasses, such. my privacy sucks, so i bought a van, it has a bed, table, heating, I have a lot of time. The bland game, and everything was born here. I have a lack of ideas lately. I'm suffering. I would do something so much !!!! I drank wine and made this nonsense in embarrassment. What should I do? Give me an idea! :)

FellippeHeitor

  • Guest
Re: i suffer
« Reply #2 on: March 04, 2021, 03:01:30 pm »
the code is pretty cool tho.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: i suffer
« Reply #3 on: March 04, 2021, 03:11:31 pm »
Yeah reminds me of Curlie Borealis or Guts :)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: i suffer
« Reply #4 on: March 04, 2021, 03:17:03 pm »
Quote
I have a lack of ideas lately. I'm suffering. I would do something so much !!!! I drank wine and made this nonsense in embarrassment. What should I do? Give me an idea! :)

https://www.qb64.org/forum/index.php?topic=3713.0
Quote
TYPE elements are always* initialised to 0. This includes when REDIMming an array of them.

* There's an elusive bug that sometimes causes elements to not be initialised to 0, but this is only for TYPEs that have an AS STRING element.

Find the elusive bug and make as simple example as possible that can be replicated by us to show what bad things  happens  when one assumes all is zero or "" in freshly minted UDT. Maybe we could Kill the bug for good if we have an example that can be replicated.



Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: i suffer
« Reply #5 on: March 04, 2021, 03:19:10 pm »
@bplus I think as long as we get in the habit of initializing variables and then setting them to zero then we should be ok. Or, using that ZeroMemory function and getting it cleared out for sure without needing a loop.
Shuwatch!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: i suffer
« Reply #6 on: March 04, 2021, 03:23:57 pm »
@bplus I think as long as we get in the habit of initializing variables and then setting them to zero then we should be ok. Or, using that ZeroMemory function and getting it cleared out for sure without needing a loop.

I would like to feel safe to assume all is 0 or "" without extraordinary efforts from a new variable or UDT.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: i suffer
« Reply #7 on: March 04, 2021, 03:25:13 pm »
@bplus
It really isn't safe to assume zero or "" for any variable. Think about C/C++, for instance. In code examples they almost always declare a variable and then immediately set it to zero or an empty string.
Shuwatch!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: i suffer
« Reply #8 on: March 04, 2021, 03:40:19 pm »
@SpriggsySpriggs

Think of the founders of BASIC and their mission to get a PL for non professional programmers or computer scientists.

Besides I am merely suggesting an idea for a challenging problem, you don't have to like it ;-))

MasterGy is extremely clever fellow, hate to see good mind wasted by wine.
« Last Edit: March 04, 2021, 03:46:02 pm by bplus »

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Re: i suffer
« Reply #9 on: March 04, 2021, 03:48:30 pm »
@MasterGy - not sure if you can access TED TALKS or maybe it's just TED, but they apparently have some discussions on Where Ideas originate. Glass of Wine, feet up on the table in the van, laptop blaring out a good Ted Talk.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: i suffer
« Reply #10 on: March 04, 2021, 03:49:38 pm »
@SpriggsySpriggs
Besides I am merely suggesting an idea for a challenging problem, you don't have to like it ;-))

@bplus I'm not saying I don't like it. I was suggesting ways of getting around it for now and suggesting using more modern code practices. There's nothing wrong with wanting it to already be zero. If we can guarantee it to always be zero then that's neat and saves some trouble. I don't expect we'll get to a point of guaranteeing that anytime soon, though. The main thing now would be to make them zero or assign them a value immediately.
Shuwatch!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: i suffer
« Reply #11 on: March 04, 2021, 03:55:58 pm »
Quote
I don't expect we'll get to a point of guaranteeing that anytime soon, though. The main thing now would be to make them zero or assign them a value immediately.

Yes we know the fix, why do we have to fix?

Quote
I don't expect we'll get to a point of guaranteeing that anytime soon

That because people blow off this problem, can't fix anything anytime soon if you merely wish it wasn't there and use the fix that works sure enough. Let someone else figure it out, someone who has time to kill, someone say, who is bored out of their gourd and drinks wine and doodles "shamefully"  ;-))

« Last Edit: March 04, 2021, 03:57:33 pm by bplus »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: i suffer
« Reply #12 on: March 04, 2021, 03:57:04 pm »
@bplus

Sounds like we've found your next project!
Shuwatch!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: i suffer
« Reply #13 on: March 04, 2021, 03:59:44 pm »
@bplus

Sounds like we've found your next project!

Yeah busted! I am on it at the moment but I wish MasterGy would take it off my hands ;)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: i suffer
« Reply #14 on: March 04, 2021, 04:14:25 pm »
You know this is a Nessie problem, Sasquatch, Bigfoot, Yeti of Qb64

People have had sightings but nobody can catch it or even bring back a creditable picture that isn't grainy as hell.