Welcome, Guest |
You have to register before you can post on our site.
|
Latest Threads |
лучшие песни медляки слуш...
Forum: Petr
Last Post: WillieTop
06-08-2025, 02:21 AM
» Replies: 0
» Views: 18
|
пинк слушать онлайн беспл...
Forum: SMcNeill
Last Post: WillieTop
06-08-2025, 02:20 AM
» Replies: 0
» Views: 16
|
скачать музыку российскую...
Forum: madscijr
Last Post: WillieTop
06-08-2025, 02:18 AM
» Replies: 0
» Views: 15
|
нежная музыка mp3 скачать
Forum: Keybone
Last Post: WillieTop
06-08-2025, 02:17 AM
» Replies: 0
» Views: 14
|
лучшая песня слушать онла...
Forum: bplus
Last Post: WillieTop
06-08-2025, 02:16 AM
» Replies: 0
» Views: 16
|
пикник слушать онлайн луч...
Forum: Spriggsy
Last Post: WillieTop
06-08-2025, 02:15 AM
» Replies: 0
» Views: 16
|
какая сейчас популярная м...
Forum: RhoSigma
Last Post: WillieTop
06-08-2025, 02:14 AM
» Replies: 0
» Views: 15
|
хит лета 2019 музыка на т...
Forum: Christmas Code
Last Post: WillieTop
06-08-2025, 02:12 AM
» Replies: 0
» Views: 19
|
бесплатная музыка mp3 рег...
Forum: Works in Progress
Last Post: WillieTop
06-08-2025, 02:11 AM
» Replies: 0
» Views: 15
|
лучшие хиты музыка 2018 2...
Forum: Utilities
Last Post: WillieTop
06-08-2025, 02:10 AM
» Replies: 0
» Views: 16
|
|
|
Sound Command |
Posted by: johnno56 - 12-22-2022, 08:14 AM - Forum: General Discussion
- Replies (13)
|
 |
I am some-what familiar with the sound command and its parameters. My question is: How does QB64pe generate the tones? Does it have some kind of library of tones or some other method in generating the tones or perhaps accesses the hardware (sound card) directly? Just curious...
Have a great Xmax and an even better New Year!!!
J
|
|
|
DAY 042: _BLINK |
Posted by: Pete - 12-22-2022, 01:32 AM - Forum: Keyword of the Day!
- No Replies
|
 |
Brought to you by The Keyword of the Day Update Team!
And now, our Keyword of the Day Update reporter, Roseanne Roseannadanna.
Good evening coders. Did you ever ask yourself, "Hey, wait one darn minute. What do I need with a bunch of stupid blinking text letters, when what I really need is nice little cutesie tootsie high intensity background to put my regular non-stupid non-flashing text letters on." Well now I, your Keyword of the Day Update reporter, Roseanne Roseannadanna, have just the news you want to hear!
SYNTAX: _BLINK {ON|OFF}
Usage: Disable or re-enable SCREEN 0 text blinking and provide high intensity background colors when disabled.
Demo
Code: (Select All) COLOR 16, 7: CLS
LOCATE 2, 2: PRINT "This is black blinking text over a light grey bckground. Press a key..."
SLEEP
_BLINK OFF ' This changes our background colors to high intensity colors.
LOCATE 4, 2: PRINT "Now the same text is printed in black over bright white, "
PRINT " because blinking was disabled. Press a key..."
SLEEP
COLOR 0, 7
LOCATE 7, 2: PRINT "This is the lower color register for black."
LOCATE 8, 2: PRINT "See how the background is no longer high-intensity? Press a key..."
SLEEP
COLOR 16, 7
LOCATE 10, 2: PRINT "Now let's see the high-intensity backgrounds we get with blinking disabled."
PRINT " Press a key each time to see a new background color..."
j = 0
DO
COLOR 16, j
LOCATE 13, 2: PRINT "Color 16,"; j;
j = j + 1
SLEEP
LOCATE 13, 2: PRINT SPACE$(12);
IF j = 15 THEN j = 0
LOOP
Now Jane, you may be asking yourself, "Hey Roseanne, how do I check to see if I have blinking on or off? Well I tell you Jane, you just use the _BLINK function...
Code: (Select All) IF _BLINK THEN
PRINT "I'm blinking"
ELSE
PRINT "I'm not blinking"
END IF
So there you have it. Now you can go to bed, get up tomorrow, and tell all your little friends your Keyword of the Day Update Reporter, Roseanne Roseannadanna, has a message for them: _BLINK OFF
And now, back to you, Jane...
Goodnight, and have a pleasant tomorrow.
|
|
|
Merry Xmas! Santa Steve comes bringing gifts to all!! |
Posted by: SMcNeill - 12-22-2022, 12:52 AM - Forum: Learning Resources and Archives
- Replies (14)
|
 |
https://1drv.ms/u/s!AknUrv8RXVYMm_UjHLPp...q8Lyc?dl=1
As usual, it's Christmas time once again, and those of you who have been members of the QB64 community for a while, you know what that means!! It's the time of year when Santa Steve shows up and offers a hard drive full of goodies for one and all!
Now most years, Santa Steve just downloads and archives the QB64 wiki, and makes them available for one and all so they can have full access to the year's newest wiki information -- but this year, Santa Steve has went above and beyond even that!! This year, Santa Steve is hosting and offering the whole QB64-PE FORUMS as well as the QB64-PE WIKI for everyone to enjoy!!
https://1drv.ms/u/s!AknUrv8RXVYMm_UjHLPp...q8Lyc?dl=1
Grab it at the link above!!
Grab it at this link: https://1drv.ms/u/s!AknUrv8RXVYMm_UjHLPp...q8Lyc?dl=1
Grab it at the link below:
https://1drv.ms/u/s!AknUrv8RXVYMm_UjHLPp...q8Lyc?dl=1
If you want it, there's no reason why you can't grab a copy of the QB64-PE Archives for 2022! It's free! It's available for one and all!
If you're in a country or area that absolutely can't download the 1.3GB archive, then post here! It's Christmas time, for goodness sake! Somebody can burn off a copy of the archive to a DVD and snail mail it to you, if that's absolutely necessary!
QB64-PE Archives 2022 -- for one and for all!!
Enjoy, guys! (And you gals out there too!)
|
|
|
Asteroid Shower |
Posted by: mnrvovrfc - 12-22-2022, 12:08 AM - Forum: Programs
- Replies (13)
|
 |
The idea of this rather simple game comes from "Astrostorm", which I beheld first on an Apple IIe nearly 40 years back!
Lazy game program. Just press spacebar to start or stop your spaceship. Beware: the response could be a bit late. Work your way toward the top of the screen. The game ends if your spaceship is bashed by an asteroid.
Code: (Select All) 'by mnrvovrfc 2022-dec-21
OPTION _EXPLICIT
DIM AS INTEGER px, py, ph, cm, cb, uc, j, ay, ax, fc
DIM AS LONG kk
DIM AS _BYTE dead, done, holdspace
DIM AS STRING sp40
_TITLE "Astroshower LC"
WIDTH 40, 25: CLS
px = 1: py = 20: ph = 0: cm = 10: cb = 0: kk = 0
sp40 = SPACE$(40)
dead = 0
done = 0
holdspace = 0
uc = 20
fc = 8
LOCATE 24, 1: COLOR 7: PRINT 0;
LOCATE py, px: COLOR fc: PRINT ">";
DO UNTIL dead OR done
IF uc > 0 THEN
uc = uc - 1
IF uc < 1 THEN fc = 15
END IF
FOR j = 1 TO 5
_DELAY 0.015
IF uc < 1 THEN
IF _KEYDOWN(27) THEN done = 1: EXIT FOR
IF _KEYDOWN(32) AND holdspace = 0 THEN
IF cm > 0 THEN cm = cm - 1
holdspace = 1
IF ph = 0 THEN ph = 1 ELSE ph = 0
END IF
IF _KEYDOWN(32) = 0 AND holdspace THEN holdspace = 0
END IF
NEXT ''j
IF done THEN EXIT DO
_DISPLAY
IF ph = 1 THEN
kk = kk + cm + 1
LOCATE 24, 1: COLOR 7: PRINT kk;
COLOR 15
LOCATE py, px: PRINT " ";
px = px + ph
IF px > 40 THEN
px = 1
ph = 0
IF py > 10 THEN
py = py - 1
cb = cb + 1
END IF
cm = cm + cb
END IF
IF SCREEN(py, px) = 42 THEN dead = 1: EXIT DO
LOCATE py, px: PRINT ">";
END IF
j = random1(7) - 4
IF j > 0 THEN
COLOR 7
DO WHILE j > 0
DO
ax = random1(38) + 1
LOOP UNTIL SCREEN(1, ax) = 32
LOCATE 1, ax: PRINT "*";
j = j - 1
LOOP
END IF
LOCATE py, px: COLOR fc: PRINT " ";
COLOR 7
ay = 23
DO WHILE ay > 1
ax = 40
DO WHILE ax > 1
LOCATE ay, ax: PRINT CHR$(SCREEN(ay - 1, ax));
ax = ax - 1
LOOP
ay = ay - 1
LOOP
LOCATE 1, 1: PRINT sp40;
IF SCREEN(py, px) = 42 THEN dead = 1: EXIT DO
LOCATE py, px: COLOR fc: PRINT ">";
LOOP
_AUTODISPLAY
IF dead THEN
LOCATE 1, 1: COLOR 4
PRINT "You have died!";
END
END IF
SYSTEM
FUNCTION random1& (maxval)
random1 = INT(RND * maxval + 1)
END FUNCTION
|
|
|
Library help |
Posted by: Pete - 12-21-2022, 08:22 PM - Forum: Help Me!
- Replies (15)
|
 |
Anyone know where I can find a cute librarian? Oops, wrong forum...
I'm finding I'd like to have several shorter libraries, rather than combined functions made into a single libraries. For example, I can have a single gui library that creates a form, allows user selection and input, and produces menus, or...
I can have...
Keyboard / Mouse library
Menu library
Form library
Input Text library
What's cool is each of the above could be ported to other apps.
So here's my options...
1) Each library loads the DIM SHARD statements into the main.
2) I have to pass all variables from every library I create, regardless if libraries I include in my app only use some of those variables and arrays.
Frankly I'm leaning towards option 1. To get around naming issues, I'd go with naming the variables in relation to the library they are best associated with like MyMenuChoices$, etc.
What do you guys think or do?
Pete
|
|
|
suggestion: initialize array values within the DIM statement |
Posted by: bobalooie - 12-21-2022, 03:36 AM - Forum: General Discussion
- Replies (19)
|
 |
How difficult would it be to implement something similar to this in QB64PE?
OPTION _EXPLICIT
DIM AS LONG LNUMS(5) = {1, 2, 5, 8, 4000}
This is syntax similar to C, and it is also supported to an extent by FreeBASIC. I have used this construct in FreeBASIC, and I have found it useful when initializing short arrays of 'fixed' data in a program.
(I always use OPTION _EXPLICIT, it has saved me more than a few times from fat-fingered typing.)
|
|
|
QB64 crash!? |
Posted by: eoredson - 12-21-2022, 03:27 AM - Forum: Help Me!
- Replies (5)
|
 |
Try this code and tell me what happens..
btw: It does not display an error..
Code: (Select All) Print clock$
Function clock$
clock$ = "date/time is:"
clock$ = clock$ + Date$ + " " + Time$
End Function
|
|
|
DAY 041: ELSEIF |
Posted by: Pete - 12-21-2022, 02:29 AM - Forum: Keyword of the Day!
- Replies (3)
|
 |
Sounds like a keyword my av-ee-tar would like. ELSEIF ya don't, I'm eh gonna blast youse.
Okay, settle down Yosemite, and let's have a look at this handy conditional statement.
SYNTAX:
IF foo1 THEN
ELSEIF foo2 THEN
END IF
Usage: Handles multiple conditions while excluding program flow through unnecessary evaluation statements.
This is a nice alternative to SELECT CASE, and better than forcing your program through multiple IF/THEN statements, which could cause more than one desired condition to be triggered.
Example:
Code: (Select All) a = 1: b = 2
IF a > b OR j = 0 THEN
PRINT "1"
ELSEIF a = b OR j = 0 THEN PRINT "2"
ELSEIF a < b OR j = 0 THEN PRINT "3"
END IF
PRINT "---------------------------------"
IF a > b OR j = 0 THEN PRINT "1"
IF a = b OR j = 0 THEN PRINT "2"
IF a < b OR j = 0 THEN PRINT "3"
So by using IF THEN with ELSEIF in a block statement we get an output of '1' and done in the first condition block vs all three numbers printed out in the second IF/THEN only block.
--------------------------------------------------------------------------------------
Edit: Oh, here's a fun coding fact, inspired by mn's post below....
We can code a regular IF/THEN non-block statement with THEN (line number)...
...but with an IF/THEN/ESLEIF, the THEN part cannot reference a line number without using GOTO with it.:
Code: (Select All) IF a = b THEN 5 ' This is accepted.
PRINT "Skip me!"
5 PRINT "Okay, I skipped you!"
IF a = b THEN
PRINT "Okay!"
ELSEIF a < b THEN GOTO 5 ' You have to include GOTO here or it won't compile.
END IF
Pete
|
|
|
DAY 040: _TOGGLEBIT |
Posted by: Pete - 12-19-2022, 07:43 PM - Forum: Keyword of the Day!
- Replies (16)
|
 |
Here is an interesting one for all you bit flipping coders out there...
_TOGGLEBIT
SYNTAX result = _TOGGLEBIT(numericalVariable, numericalValue)
Usage: For cross breeding elephants and rhinos. What's that good for? Eleph-i-no!
Okay, I know bit-flipping can be used somehow to detect a hardware malfunction in a Windows operating system. I would imagine encryption would be another practical use. I also did some reading on using bit-flipping as an alternative to doing string math, but that was a very involved process, so I have no work created to demonstrate how that would be accomplished.
What I can easily see if we flip the first bit, we can get a 0 or 1, which is good for a toggle function.
Now the easiest method to create your own toggle for a program has been demonstrated in this forum numerous times...
toggle = 1 - toggle Mark posted about that one months ago.
So using toggle = 1 - toggle we start out with toggle = 0, hence 1 - 0 = 1. Loop again and 1 - 1 = 0
Now we can accomplish the exact same toggle effect with _TOGGLEBIT, as follows...
Code: (Select All) DIM a AS INTEGER ' Also avilable are _INTEGER64, LONG, _UNSIGNED, and _BYTE,
DO
DO
SELECT CASE a
CASE 0
PRINT " Steve is good...";
CASE 1
PRINT " Pete is better!": PRINT
END SELECT
SLEEP
a = _TOGGLEBIT(a, 0)
mykey$ = INKEY$
LOOP UNTIL mykey$ = CHR$(9) OR mykey$ = CHR$(27)
PRINT
FOR i = 0 TO 15
PRINT i; _TOGGLEBIT(a, i)
NEXT
PRINT
LOOP UNTIL mykey$ = CHR$(27)
So maybe this example will goad Steve a "bit" to elaborate on some of his experiences with _TOGGLEBIT. Also, I'd love to hear some comments from @jack about bit-flipping, and his experience with coding decfloat.
Pete
|
|
|
|