-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
129 changed files
with
7,655 additions
and
4 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md) | ||
|
||
## SAMPLES: 254 CHARS | ||
|
||
**[Bubbles](bubbles/index.md)** | ||
|
||
[🐝 Tom Sales](tom-sales.md) 🔗 [screensaver](screensaver.md), [dos world](dos-world.md), [254 chars](254-chars.md) | ||
|
||
Copyright (C) 1994-95 DOS Resource Guide/DOS World Published in Issue #17, September 1994, page ... | ||
|
||
**[Die Odds](die-odds/index.md)** | ||
|
||
[🐝 Tom Sales](tom-sales.md) 🔗 [statistics](statistics.md), [dos world](dos-world.md), [254 chars](254-chars.md) | ||
|
||
Copyright (C) 1994-95 DOS Resource Guide/DOS World Published in Issue #17, September 1994, page ... | ||
|
||
**[ESP](esp/index.md)** | ||
|
||
[🐝 Tom Sales](tom-sales.md) 🔗 [statistics](statistics.md), [dos world](dos-world.md), [254 chars](254-chars.md) | ||
|
||
Copyright (C) 1994-95 DOS Resource Guide/DOS World Published in Issue #17, September 1994, page ... | ||
|
||
**[Flip](flip/index.md)** | ||
|
||
[🐝 Tom Sales](tom-sales.md) 🔗 [statistics](statistics.md), [dos world](dos-world.md), [254 chars](254-chars.md) | ||
|
||
Copyright (C) 1994-95 DOS Resource Guide/DOS World Published in Issue #17, September 1994, page ... | ||
|
||
**[Globs 0](globs-0/index.md)** | ||
|
||
[🐝 Tom Sales](tom-sales.md) 🔗 [screensaver](screensaver.md), [dos world](dos-world.md), [254 chars](254-chars.md) | ||
|
||
Copyright (C) 1994-95 DOS Resource Guide/DOS World Published in Issue #17, September 1994, page ... | ||
|
||
**[Globs 1](globs-1/index.md)** | ||
|
||
[🐝 Rick Ellis](rick-ellis.md) 🔗 [screensaver](screensaver.md), [dos world](dos-world.md), [254 chars](254-chars.md) | ||
|
||
Copyright (C) 1994-95 DOS Resource Guide/DOS World Published in Issue #17, September 1994, page ... | ||
|
||
**[InYrFace](inyrface/index.md)** | ||
|
||
[🐝 Tom Sales](tom-sales.md) 🔗 [screensaver](screensaver.md), [dos world](dos-world.md), [254 chars](254-chars.md) | ||
|
||
Copyright (C) 1994-95 DOS Resource Guide/DOS World Published in Issue #17, September 1994, page ... | ||
|
||
**[Slot](slot/index.md)** | ||
|
||
[🐝 Tom Sales](tom-sales.md) 🔗 [money](money.md), [dos world](dos-world.md), [254 chars](254-chars.md) | ||
|
||
Copyright (C) 1994-95 DOS Resource Guide/DOS World Published in Issue #17, September 1994, page ... | ||
|
||
**[Wheel O](wheel-o/index.md)** | ||
|
||
[🐝 Tom Sales](tom-sales.md) 🔗 [game](game.md), [dos world](dos-world.md), [254 chars](254-chars.md) | ||
|
||
Copyright (C) 1994-95 DOS Resource Guide/DOS World Published in Issue #17, September 1994, page ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md) | ||
|
||
## SAMPLE: AMERICAN FLAG | ||
|
||
![screenshot.png](img/screenshot.png) | ||
|
||
### Author | ||
|
||
[🐝 Vince](../vince.md) | ||
|
||
### Description | ||
|
||
```text | ||
Waving American Flag demo by Vince. | ||
``` | ||
|
||
### QBjs | ||
|
||
> Please note that QBjs is still in early development and support for these examples is extremely experimental (meaning will most likely not work). With that out of the way, give it a try! | ||
* [LOAD "usflag2.bas"](https://v6p9d9t4.ssl.hwcdn.net/html/5963335/index.html?src=https://qb64.com/samples/american-flag/src/usflag2.bas) | ||
* [RUN "usflag2.bas"](https://v6p9d9t4.ssl.hwcdn.net/html/5963335/index.html?mode=auto&src=https://qb64.com/samples/american-flag/src/usflag2.bas) | ||
* [PLAY "usflag2.bas"](https://v6p9d9t4.ssl.hwcdn.net/html/5963335/index.html?mode=play&src=https://qb64.com/samples/american-flag/src/usflag2.bas) | ||
|
||
### File(s) | ||
|
||
* [usflag2.bas](src/usflag2.bas) | ||
|
||
🔗 [2d](../2d.md), [graphics](../graphics.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
Option _Explicit | ||
DefLng A-Z | ||
|
||
Dim sw, sh | ||
Dim h, w, a | ||
Dim img | ||
Dim x0, y0, x, y, dz | ||
Dim tl, tr, bl, br | ||
Dim r, g, b | ||
Dim i, j, t | ||
|
||
sw = 640 | ||
sh = 480 | ||
|
||
Dim Shared pi As Double | ||
pi = 4 * Atn(1) | ||
|
||
Screen _NewImage(sw, sh, 32) | ||
|
||
h = 300 | ||
w = 1.9 * h | ||
a = h / 7 | ||
|
||
img = _NewImage(w, h, 32) | ||
_Dest img | ||
x0 = 0 | ||
y0 = 0 | ||
|
||
Line (0, 0)-Step(w, h), _RGB(255, 255, 255), BF | ||
For i = 0 To 6 | ||
Line (0, i * h * 2 / 13)-Step(w, h / 13), _RGB(255 * 0.698, 255 * 0.132, 255 * 0.203), BF | ||
Next | ||
Line (0, 0)-Step(w * 2 / 5, h * 7 / 13), _RGB(255 * 0.234, 255 * 0.233, 255 * 0.430), BF | ||
|
||
For i = 0 To 4 | ||
For j = 0 To 5 | ||
starf (j * 2 + 1) * w * 2 / (5 * 12), (i * 2 + 1) * h * 7 / 130, h * 4 / (13 * 5 * 2), _RGB(255, 255, 255) | ||
Next | ||
Next | ||
|
||
For i = 1 To 4 | ||
For j = 1 To 5 | ||
starf (j * 2) * w * 2 / (5 * 12), (i * 2) * h * 7 / 130, h * 4 / (13 * 5 * 2), _RGB(255, 255, 255) | ||
Next | ||
Next | ||
|
||
_Dest 0 | ||
'_putimage (sw/2 - w/2, sh/2 - h/2), img | ||
_Source img | ||
|
||
x0 = sw / 2 - w / 2 '+ sw | ||
y0 = sh / 2 - h / 2 '+ sh | ||
|
||
Dim t As Double | ||
Dim z As Double | ||
|
||
Dim xx As Double, yy As Double | ||
Dim dx As Double, dy As Double | ||
Do | ||
t = t + 0.2 | ||
|
||
Line (0, 0)-Step(sw, sh), _RGB(0, 0, 0), BF | ||
|
||
For y = 0 To h + a * 0.707 Step 1 | ||
For x = 0 To w + a * 0.707 Step 1 | ||
z = (0.1 + 0.4 * (x / w)) * a * Sin(x / 35 - y / 70 - t) + 0.5 * a | ||
dz = 50 * a * Cos(x / 35 - y / 70 - t) / 35 | ||
|
||
xx = x + z * 0.707 - a * 0.707 | ||
yy = y - z * 0.707 | ||
|
||
If (Int(xx) >= 0 And Int(xx) < w - 1 And Int(yy) >= 0 And Int(yy) < h - 1) Then | ||
tl = Point(Int(xx), Int(yy)) | ||
tr = Point(Int(xx) + 1, Int(yy)) | ||
bl = Point(Int(xx), Int(yy) + 1) | ||
br = Point(Int(xx) + 1, Int(yy) + 1) | ||
|
||
dx = xx - Int(xx) | ||
dy = yy - Int(yy) | ||
|
||
r = _Round((1 - dy) * ((1 - dx) * _Red(tl) + dx * _Red(tr)) + dy * ((1 - dx) * _Red(bl) + dx * _Red(br))) | ||
g = _Round((1 - dy) * ((1 - dx) * _Green(tl) + dx * _Green(tr)) + dy * ((1 - dx) * _Green(bl) + dx * _Green(br))) | ||
b = _Round((1 - dy) * ((1 - dx) * _Blue(tl) + dx * _Blue(tr)) + dy * ((1 - dx) * _Blue(bl) + dx * _Blue(br))) | ||
|
||
r = r + dz | ||
g = g + dz | ||
b = b + dz | ||
|
||
If r < 0 Then r = 0 | ||
If r > 255 Then r = 255 | ||
If g < 0 Then g = 0 | ||
If g > 255 Then g = 255 | ||
If b < 0 Then b = 0 | ||
If b > 255 Then b = 255 | ||
|
||
PSet (x0 + x, y0 - a * 0.707 + y), _RGB(r, g, b) | ||
End If | ||
Next | ||
Next | ||
|
||
_Display | ||
_Limit 50 | ||
Loop Until _KeyHit = 27 | ||
|
||
Sleep | ||
System | ||
|
||
Sub starf (x, y, r, c) | ||
Dim i, xx, yy | ||
PSet (x + r * Cos(pi / 2), y - r * Sin(pi / 2)), c | ||
For i = 0 To 5 | ||
xx = r * Cos(i * 4 * pi / 5 + pi / 2) | ||
yy = r * Sin(i * 4 * pi / 5 + pi / 2) | ||
Line -(x + xx, y - yy), c | ||
Next | ||
Paint (x, y), c | ||
For i = 0 To 5 | ||
xx = r * Cos(i * 4 * pi / 5 + pi / 2) / 2 | ||
yy = r * Sin(i * 4 * pi / 5 + pi / 2) / 2 | ||
Paint (x + xx, y - yy), c | ||
Next | ||
End Sub | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Home](https://qb64.com) • [News](../news.md) • [GitHub](../github.md) • [Wiki](../wiki.md) • [Samples](../samples.md) • [Media](../media.md) • [Community](../community.md) • [Rolodex](../rolodex.md) • [More...](../more.md) | ||
|
||
## SAMPLES: BEZIER | ||
|
||
**[Curve Approximator](curve-approximator/index.md)** | ||
|
||
[🐝 Vince](vince.md) 🔗 [curve](curve.md), [bezier](bezier.md) | ||
|
||
Curve Approximator by Vince. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
[Home](https://qb64.com) • [News](../../news.md) • [GitHub](../../github.md) • [Wiki](../../wiki.md) • [Samples](../../samples.md) • [Media](../../media.md) • [Community](../../community.md) • [Rolodex](../../rolodex.md) • [More...](../../more.md) | ||
|
||
## SAMPLE: BIG LEDS | ||
|
||
![screenshot.png](img/screenshot.png) | ||
|
||
### Author | ||
|
||
[🐝 Scott Edwards](../scott-edwards.md) | ||
|
||
### Description | ||
|
||
```text | ||
' BIG_LEDS.BAS | ||
' by Scott Edwards | ||
' Copyright (C) 1994 DOS World Magazine | ||
' Published in Issue #19, January 1995, page 62 | ||
***************************************************************************** | ||
BIG_LEDS.BAS | ||
by Scott Edwards | ||
Copyright (C) 1994 DOS World Magazine | ||
Published in Issue #19, January 1995, page 62 | ||
If you've ever wanted your QBasic programs to display GIANT numbers on your | ||
display, this program is for you. BIG_LEDS.BAS demonstrates the usage of two | ||
subroutines, DISPLAY and LED, that display large numbers that look like the | ||
LED display on a digital clock or wrist watch. The demo program displays a | ||
four-digit value as it counts from zero to 9999, updating the display once | ||
per second. You can stop the demo at any time by pressing any key. | ||
To run the program from the DOS command line, change to the directory | ||
containing BIG_LEDS.BAS, then type: | ||
QBASIC /RUN BIG_LEDS | ||
Like a real LED (light emitting diode) display, each numeral displayed by | ||
this program consists of seven segments, each of which can be on or off. The | ||
number 8, for example. uses all seven segments: | ||
**** | ||
* * | ||
* * | ||
**** | ||
* * | ||
* * | ||
**** | ||
The DISPLAY subroutine extracts the digits of the number you want to display, | ||
converts it to a bit pattern and feeds it to the LED subroutine. The LED | ||
subroutine turns each segment on or off according to the pattern of bits | ||
provided in the integer variable SEGS%. | ||
The demo program's main loop consists of just five lines: | ||
FOR X = 0 TO 9999 | ||
DISPLAY (X): SLEEP 1 | ||
IF INKEY$ <> "" THEN SYSTEM | ||
NEXT X | ||
END | ||
This FOR...NEXT loop counts from 0 to 9999 and calls the DISPLAY subroutine | ||
each time through the loop. If you press any key, the program exits back to | ||
the QBasic environment. | ||
You may customize the program by changing the values of the constants that | ||
set the color, size, and screen position of the LED numerals. The constant | ||
SCALE controls the spacing of the numerals. Only four values are useful: | ||
1(small), 2(medium), 3(huge), and 4(jumbo). If you change SCALE, you must | ||
also change the "Sn" value for constants A$ through G$. If you set SCALE to | ||
1, for instance, the line that sets the value of A$ must be changed to: | ||
CONST A$ = "S1 B M+0,-242 B R4 E8 R80 F8 G8 L80 H8 B R10" | ||
In this example, S4 was changed to S1 because SCALE was changed from 4 to 1. | ||
You may change the color of the numerals by altering the value of the | ||
constant LIT. Values of 1 through 15 are permissible. To change the location | ||
at which the numerals are displayed, substitute new values for the constants | ||
XBASE and YBASE. Reducing XBASE moves the display to the left, increasing it | ||
moves the display to the right. Reducing YBASE moves the display up, | ||
increasing it moves the display down. | ||
To use these routines in a program of your own, add the entire BIG_LEDS.BAS | ||
listing to your program, except for the five lines shown above that comprise | ||
the main program loop of the demo program. The easiest way to do this is to | ||
Open BIG_LEDS.BAS in QBasic, Copy the relevant portions of the listing, Open | ||
your program, and Paste the copied portion of BIG_LEDS.BAS into your program. | ||
Now anytime you want to display a BIG number, insert the statement Display | ||
(X) into your program, after first setting X equal to the number you wish to | ||
display. | ||
``` | ||
|
||
### QBjs | ||
|
||
> Please note that QBjs is still in early development and support for these examples is extremely experimental (meaning will most likely not work). With that out of the way, give it a try! | ||
* [LOAD "big_leds.bas"](https://v6p9d9t4.ssl.hwcdn.net/html/5963335/index.html?src=https://qb64.com/samples/big-leds/src/big_leds.bas) | ||
* [RUN "big_leds.bas"](https://v6p9d9t4.ssl.hwcdn.net/html/5963335/index.html?mode=auto&src=https://qb64.com/samples/big-leds/src/big_leds.bas) | ||
* [PLAY "big_leds.bas"](https://v6p9d9t4.ssl.hwcdn.net/html/5963335/index.html?mode=play&src=https://qb64.com/samples/big-leds/src/big_leds.bas) | ||
|
||
### File(s) | ||
|
||
* [big_leds.bas](src/big_leds.bas) | ||
|
||
🔗 [clock](../clock.md), [dos world](../dos-world.md) |
Oops, something went wrong.