Author Topic: QB64SOURCECODE.COM  (Read 17536 times)

0 Members and 1 Guest are viewing this topic.

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #15 on: April 19, 2020, 10:00:13 pm »
All of the links in what I have uploaded now work (tasks 1 through 10). The link to the forward now works and I added links to the QB64 site areas of interest on the bottom of the home page.

It's been taking me anywhere from 1 to 4 days to get each task completed so if you check once a week you'll probably see a few more tasks added. I will also get the asset files download working tonight and as I add more tasks the asset file will get updated with the new content. I'll post an announcement and date on the home page when the asset file needs to be downloaded to get the latest content.

By the way, it was an email from qbkiller101 about a month ago that led me to update the tutorial. He enjoyed doing the "Your Turn" sections of the tutorials and was hoping I would add the ones that were not there. Awesome that someone his age wants to learn programming.
In order to understand recursion, one must first understand recursion.

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #16 on: April 20, 2020, 09:35:24 am »
Thank you very much for this site Terry. I know you are still working on the site, would have any plans for a section on QB64 and mouse control? I haven't gone through the site completely, maybe there is something on working the mouse in there already.

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #17 on: April 20, 2020, 09:46:06 am »
Task 9: Gathering Input. I cover all aspects of mouse input with example code. The asset file can now be downloaded as well which contains the .BAS files of all code seen in the tasks. Go to Task 1 to download the asset file.
In order to understand recursion, one must first understand recursion.

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #18 on: April 20, 2020, 02:17:16 pm »
ah yes - thanks again.

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #19 on: April 21, 2020, 02:21:51 am »
Task 11 has been added and the asset file updated.
In order to understand recursion, one must first understand recursion.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #20 on: April 21, 2020, 11:16:54 am »
Really great work, glad you are working to complete the lessons, thumbs up!

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #21 on: April 21, 2020, 02:44:46 pm »
Hi Terry - again, sorry if I have missed this but is there a section/paragraph on Sound or String Math? Would you have any plans to add a Search feature? I think it's the color, common sense or just the layout of your Source Code site that has me. Not to mention, when you are not strong in coding, the "ah ha" moments it provides.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #22 on: April 21, 2020, 02:57:49 pm »
Did I hear someone mention string math? Hey Terry, if you want to add that at some point, and if you don't have a routine of your own, you are welcome to look into using mine.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #23 on: April 21, 2020, 05:49:53 pm »
Yep, a sound and math section are coming too. I figure there will be 25 sections when completed. The first math tutorial which I happen to working on right now will be the basic commands and their usage.

I'm designing the tutorials to be beginner oriented for the first half. The second half will be advanced topics building on what was learned in the first half. When I get to the advanced topics I'm sure I'll be asking for help and code examples, especially for the higher math, physics, and 3D related topics.

@Dimster Do you mean a section on search engines or a search engine for the site?

@Dimster @Pete String math?

This is what I have laid out for now

Task 1 - Install and setup QB64
Task 2 - Introducing the IDE
Task 3 - Your first program
Task 4 - Introducing variables
Task 5 - Conditions and branching
Task 6 - Looping
Task 7 - Graphics
Task 8 - Subroutines and functions
Task 9 - Gathering input
Task 10 - Variable arrays
Task 11 - String manipulation
Task 12 - Math functions
Task 13 - File input and output
Task 14 - Music and sound effects (end of beginner course)
Task 15 - Game design concepts
Task 16 - Advanced graphics
Task 17 - Sprites and sprite sheets
Task 18 - Collision detection and avoidance
Task 19 - Physics and timing
Task 20 - 3D and OpenGL
Task 21 - Recursion                         (end of advanced course)
Task 22 - Beginner build: Hangman (start of build series)
Task 23 - Intermediate build: Pong
Task 24 - Advanced build: Missile command
Task 25 - Expert build: Pac-Man
In order to understand recursion, one must first understand recursion.

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #24 on: April 21, 2020, 05:50:13 pm »
Really great work, glad you are working to complete the lessons, thumbs up!

Thanks :-)
In order to understand recursion, one must first understand recursion.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #25 on: April 21, 2020, 05:58:47 pm »
String math as is using string variables instead of numeric variables to get around base 2 computer math errors.

From the thread: https://www.qb64.org/forum/index.php?topic=1093.30 or https://www.tapatalk.com/groups/qbasic/working-on-some-ideas-for-base-10-math-operations--t39442.html

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 469
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #26 on: April 21, 2020, 07:15:45 pm »
I'm really looking forward to tasks 18 & 19. I've been bumping into those sorts of thorny issues lately.

Offline Dimster

  • Forum Resident
  • Posts: 500
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #27 on: April 22, 2020, 12:03:06 pm »
Terry - Search the site is what I meant - aka Wiki on Steroids
        - Pete's String Math. Finding some useful uses as it's more forgiving if I didn't DIM the variable correctly or math routine takes the result into Sc Note. Also a little handier with _PrintString
           then covering numeric to string and _Printstring. But I'm unsure of how to get the most out of it.


Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #28 on: April 22, 2020, 06:44:05 pm »
Hi Terry
your work is wonderful!
I like the new style of your site!
I like your long project to bring until game building in the last chapters.

If you agree I must stress that the information about _PRESERVE option of REDIM seems to me uncomplete!  (chapter 10)
For now it seems to me that it works only on monodimensional arrays, both of simple type of data both of UDT. In the future it peharps can be extended to multidimensionale arrays.

here a demonstration
Code: QB64: [Select]
  1. ' monodimensional single element array
  2. REDIM a(1 TO 10) AS INTEGER
  3. PRINT " Initialize array a(1 to 10)"
  4. FOR b = 1 TO 10 STEP 1
  5.     a(b) = b * 11
  6.  
  7. PRINT "Showing array a(1 to 10)"
  8. FOR b = 1 TO 10 STEP 1
  9.     PRINT a(b); " ";
  10. PRINT "REDIM array a(1 to 15)"
  11. PRINT "Re showing array a(1 to 15)"
  12. FOR b = 1 TO UBOUND(a) STEP 1
  13.     PRINT a(b); " ";
  14.  
  15. TYPE poli
  16.     a AS INTEGER
  17.     b AS STRING * 3
  18.     c AS DOUBLE
  19. REDIM z(1 TO 10) AS poli
  20. PRINT "initialize array z(1 to 10) of UDT"
  21. FOR b = 1 TO 10 STEP 1
  22.     z(b).a = b
  23.     z(b).b = STR$(b)
  24.     z(b).c = b / 20
  25. PRINT "showing z array..."
  26. FOR b = 1 TO 10 STEP 1
  27.     PRINT z(b).a; " "; z(b).b; " "; z(b).c; "---"
  28. PRINT "REDIM z(1 to 15) of UDT"
  29. REDIM _PRESERVE z(1 TO 15) AS poli
  30. PRINT "Re showing z(1 to 15) of UDT"
  31. FOR b = 1 TO UBOUND(z) STEP 1
  32.     LOCATE 8 + b, 40: PRINT z(b).a; " "; z(b).b; " "; z(b).c; "---"
  33. PRINT " now we create a polidimensional array of integer"
  34. REDIM z1(1 TO 10, 1 TO 10, 1 TO 10) AS INTEGER
  35. PRINT "initialize array z1(1 to 10, 1 to 10, 1 to 10) of integer"
  36. FOR b = 1 TO 10 STEP 1
  37.     FOR c = 1 TO 10 STEP 1
  38.         FOR d = 1 TO 10 STEP 1
  39.             z1(b, c, d) = b
  40.             z1(b, c, d) = b * 10
  41.             z1(b, c, d) = b * 20
  42. NEXT d, c, b ' in multiple next the order is inverse to the entry
  43.  
  44. PRINT "showing z1 array..."
  45. FOR b = 1 TO 10 STEP 1
  46.     FOR c = 1 TO 10 STEP 1
  47.         FOR d = 1 TO 10 STEP 1
  48.  
  49.             PRINT z1(b, c, d); " "; z1(b, c, d); " "; z1(b, c, d); "/";
  50. NEXT d, c, b
  51. PRINT "REDIM z1(1 to 15) of UDT"
  52. REDIM _PRESERVE z1(1 TO 15, 1 TO 15, 1 TO 15) AS INTEGER
  53. PRINT "Re showing z1(1 to 15,1 to 15 , 1 to 15) integer"
  54. FOR b = 1 TO UBOUND(z1) STEP 1
  55.     FOR c = 1 TO UBOUND(z1)
  56.         FOR d = 1 TO UBOUND(z1)
  57.             PRINT z1(b, c, d); " "; z1(b, c, d); " "; z1(b, c, d); "/";
  58. NEXT d, c, b
  59.  

Sorry for my pedantry but if you teach with passion and love to transmit knowledge , as I can see, this feedback can be useful.
Thanks to read
Programming isn't difficult, only it's  consuming time and coffee

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: QB64SOURCECODE.COM
« Reply #29 on: April 22, 2020, 07:05:36 pm »
Again a feedback but first a good music to hear
https://www.youtube.com/watch?v=QkF3oxziUI4&list=RDEM0rsUWBCDujUhieAggSXK-g&index=4
please read this only if you have so many patience otherwise go further

about the tip of null string  found by INSTR (chapter 11)  in an any string
Code: QB64: [Select]
  1. '-------------------------------
  2. ' Variable Declaration Section -
  3. '-------------------------------
  4.  
  5. DIM Answer$
  6.  
  7. '--------------------------
  8. ' Main Program Begins Here-
  9. '--------------------------
  10. Again:
  11. PRINT "Press only Enter key to see the tip"
  12. INPUT "Do you play again ?(Y/N)", Answer$
  13. PRINT INSTR("Y", UCASE$(Answer$))
  14. IF INSTR("Y", UCASE$(Answer$)) GOTO Again ELSE PRINT "Goodbye"

Thanks to read
Programming isn't difficult, only it's  consuming time and coffee