From 3b28ab84c7f81311de41d77f58f7591e28f1afb7 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Sun, 21 Jul 2024 13:56:44 +0300 Subject: [PATCH] Improved QBasic tutorials in group 2 --- QBasic tutorial/{group1 => Group 1}/00.bas | 0 QBasic tutorial/{group1 => Group 1}/01.bas | 0 QBasic tutorial/{group1 => Group 1}/02.bas | 0 QBasic tutorial/{group1 => Group 1}/03.bas | 0 QBasic tutorial/{group1 => Group 1}/04.bas | 0 QBasic tutorial/{group1 => Group 1}/05.bas | 0 QBasic tutorial/{group1 => Group 1}/06.bas | 0 QBasic tutorial/{group1 => Group 1}/07.bas | 0 QBasic tutorial/{group1 => Group 1}/08.bas | 0 QBasic tutorial/{group1 => Group 1}/09.bas | 0 QBasic tutorial/{group1 => Group 1}/10.bas | 0 QBasic tutorial/{group1 => Group 1}/11.bas | 0 QBasic tutorial/{group1 => Group 1}/12.bas | 0 QBasic tutorial/{group1 => Group 1}/13.bas | 0 QBasic tutorial/{group1 => Group 1}/15.bas | 0 QBasic tutorial/{group1 => Group 1}/16.bas | 0 QBasic tutorial/{group1 => Group 1}/17.bas | 0 QBasic tutorial/{group1 => Group 1}/18.bas | 0 QBasic tutorial/{group1 => Group 1}/19.bas | 0 QBasic tutorial/Group 2/01.bas | 38 ++++++++++ QBasic tutorial/Group 2/03.bas | 16 +++++ QBasic tutorial/Group 2/05.bas | 52 ++++++++++++++ QBasic tutorial/Group 2/07.bas | 36 ++++++++++ QBasic tutorial/Group 2/08.bas | 80 ++++++++++++++++++++++ QBasic tutorial/Group 2/09.bas | 21 ++++++ QBasic tutorial/Group 2/10.bas | 37 ++++++++++ QBasic tutorial/Group 2/12.bas | 45 ++++++++++++ QBasic tutorial/Group 2/13.bas | 54 +++++++++++++++ QBasic tutorial/Group 2/14.bas | 54 +++++++++++++++ QBasic tutorial/Group 2/15.bas | 26 +++++++ QBasic tutorial/Group 2/16.bas | 40 +++++++++++ QBasic tutorial/Group 2/17.bas | 58 ++++++++++++++++ QBasic tutorial/Group 2/18.bas | 56 +++++++++++++++ QBasic tutorial/{group3 => Group 3}/00.bas | 0 QBasic tutorial/{group3 => Group 3}/01.bas | 0 QBasic tutorial/{group3 => Group 3}/02.bas | 0 QBasic tutorial/{group3 => Group 3}/03.bas | 0 QBasic tutorial/{group3 => Group 3}/04.bas | 0 QBasic tutorial/{group3 => Group 3}/05.bas | 0 QBasic tutorial/{group3 => Group 3}/06.bas | 0 QBasic tutorial/{group3 => Group 3}/07.bas | 0 QBasic tutorial/{group3 => Group 3}/08.bas | 0 QBasic tutorial/{group3 => Group 3}/09.bas | 0 QBasic tutorial/{group3 => Group 3}/10.bas | 0 QBasic tutorial/{group3 => Group 3}/11.bas | 0 QBasic tutorial/group2/01.bas | 20 ------ QBasic tutorial/group2/02.bas | 14 ---- QBasic tutorial/group2/03.bas | 7 -- QBasic tutorial/group2/04.bas | 11 --- QBasic tutorial/group2/05.bas | 24 ------- QBasic tutorial/group2/06.bas | 5 -- QBasic tutorial/group2/07.bas | 10 --- QBasic tutorial/group2/08.bas | 43 ------------ QBasic tutorial/group2/09.bas | 6 -- QBasic tutorial/group2/10.bas | 21 ------ QBasic tutorial/group2/11.bas | 10 --- QBasic tutorial/group2/12.bas | 13 ---- QBasic tutorial/group2/13.bas | 27 -------- QBasic tutorial/group2/14.bas | 21 ------ QBasic tutorial/group2/15.bas | 10 --- QBasic tutorial/group2/16.bas | 19 ----- QBasic tutorial/group2/17.bas | 22 ------ QBasic tutorial/group2/18.bas | 28 -------- index.org | 8 +++ 64 files changed, 621 insertions(+), 311 deletions(-) rename QBasic tutorial/{group1 => Group 1}/00.bas (100%) rename QBasic tutorial/{group1 => Group 1}/01.bas (100%) rename QBasic tutorial/{group1 => Group 1}/02.bas (100%) rename QBasic tutorial/{group1 => Group 1}/03.bas (100%) rename QBasic tutorial/{group1 => Group 1}/04.bas (100%) rename QBasic tutorial/{group1 => Group 1}/05.bas (100%) rename QBasic tutorial/{group1 => Group 1}/06.bas (100%) rename QBasic tutorial/{group1 => Group 1}/07.bas (100%) rename QBasic tutorial/{group1 => Group 1}/08.bas (100%) rename QBasic tutorial/{group1 => Group 1}/09.bas (100%) rename QBasic tutorial/{group1 => Group 1}/10.bas (100%) rename QBasic tutorial/{group1 => Group 1}/11.bas (100%) rename QBasic tutorial/{group1 => Group 1}/12.bas (100%) rename QBasic tutorial/{group1 => Group 1}/13.bas (100%) rename QBasic tutorial/{group1 => Group 1}/15.bas (100%) rename QBasic tutorial/{group1 => Group 1}/16.bas (100%) rename QBasic tutorial/{group1 => Group 1}/17.bas (100%) rename QBasic tutorial/{group1 => Group 1}/18.bas (100%) rename QBasic tutorial/{group1 => Group 1}/19.bas (100%) create mode 100755 QBasic tutorial/Group 2/01.bas create mode 100755 QBasic tutorial/Group 2/03.bas create mode 100755 QBasic tutorial/Group 2/05.bas create mode 100755 QBasic tutorial/Group 2/07.bas create mode 100755 QBasic tutorial/Group 2/08.bas create mode 100755 QBasic tutorial/Group 2/09.bas create mode 100755 QBasic tutorial/Group 2/10.bas create mode 100755 QBasic tutorial/Group 2/12.bas create mode 100755 QBasic tutorial/Group 2/13.bas create mode 100755 QBasic tutorial/Group 2/14.bas create mode 100755 QBasic tutorial/Group 2/15.bas create mode 100755 QBasic tutorial/Group 2/16.bas create mode 100755 QBasic tutorial/Group 2/17.bas create mode 100755 QBasic tutorial/Group 2/18.bas rename QBasic tutorial/{group3 => Group 3}/00.bas (100%) rename QBasic tutorial/{group3 => Group 3}/01.bas (100%) rename QBasic tutorial/{group3 => Group 3}/02.bas (100%) rename QBasic tutorial/{group3 => Group 3}/03.bas (100%) rename QBasic tutorial/{group3 => Group 3}/04.bas (100%) rename QBasic tutorial/{group3 => Group 3}/05.bas (100%) rename QBasic tutorial/{group3 => Group 3}/06.bas (100%) rename QBasic tutorial/{group3 => Group 3}/07.bas (100%) rename QBasic tutorial/{group3 => Group 3}/08.bas (100%) rename QBasic tutorial/{group3 => Group 3}/09.bas (100%) rename QBasic tutorial/{group3 => Group 3}/10.bas (100%) rename QBasic tutorial/{group3 => Group 3}/11.bas (100%) delete mode 100755 QBasic tutorial/group2/01.bas delete mode 100755 QBasic tutorial/group2/02.bas delete mode 100755 QBasic tutorial/group2/03.bas delete mode 100755 QBasic tutorial/group2/04.bas delete mode 100755 QBasic tutorial/group2/05.bas delete mode 100755 QBasic tutorial/group2/06.bas delete mode 100755 QBasic tutorial/group2/07.bas delete mode 100755 QBasic tutorial/group2/08.bas delete mode 100755 QBasic tutorial/group2/09.bas delete mode 100755 QBasic tutorial/group2/10.bas delete mode 100755 QBasic tutorial/group2/11.bas delete mode 100755 QBasic tutorial/group2/12.bas delete mode 100755 QBasic tutorial/group2/13.bas delete mode 100755 QBasic tutorial/group2/14.bas delete mode 100755 QBasic tutorial/group2/15.bas delete mode 100755 QBasic tutorial/group2/16.bas delete mode 100755 QBasic tutorial/group2/17.bas delete mode 100755 QBasic tutorial/group2/18.bas diff --git a/QBasic tutorial/group1/00.bas b/QBasic tutorial/Group 1/00.bas similarity index 100% rename from QBasic tutorial/group1/00.bas rename to QBasic tutorial/Group 1/00.bas diff --git a/QBasic tutorial/group1/01.bas b/QBasic tutorial/Group 1/01.bas similarity index 100% rename from QBasic tutorial/group1/01.bas rename to QBasic tutorial/Group 1/01.bas diff --git a/QBasic tutorial/group1/02.bas b/QBasic tutorial/Group 1/02.bas similarity index 100% rename from QBasic tutorial/group1/02.bas rename to QBasic tutorial/Group 1/02.bas diff --git a/QBasic tutorial/group1/03.bas b/QBasic tutorial/Group 1/03.bas similarity index 100% rename from QBasic tutorial/group1/03.bas rename to QBasic tutorial/Group 1/03.bas diff --git a/QBasic tutorial/group1/04.bas b/QBasic tutorial/Group 1/04.bas similarity index 100% rename from QBasic tutorial/group1/04.bas rename to QBasic tutorial/Group 1/04.bas diff --git a/QBasic tutorial/group1/05.bas b/QBasic tutorial/Group 1/05.bas similarity index 100% rename from QBasic tutorial/group1/05.bas rename to QBasic tutorial/Group 1/05.bas diff --git a/QBasic tutorial/group1/06.bas b/QBasic tutorial/Group 1/06.bas similarity index 100% rename from QBasic tutorial/group1/06.bas rename to QBasic tutorial/Group 1/06.bas diff --git a/QBasic tutorial/group1/07.bas b/QBasic tutorial/Group 1/07.bas similarity index 100% rename from QBasic tutorial/group1/07.bas rename to QBasic tutorial/Group 1/07.bas diff --git a/QBasic tutorial/group1/08.bas b/QBasic tutorial/Group 1/08.bas similarity index 100% rename from QBasic tutorial/group1/08.bas rename to QBasic tutorial/Group 1/08.bas diff --git a/QBasic tutorial/group1/09.bas b/QBasic tutorial/Group 1/09.bas similarity index 100% rename from QBasic tutorial/group1/09.bas rename to QBasic tutorial/Group 1/09.bas diff --git a/QBasic tutorial/group1/10.bas b/QBasic tutorial/Group 1/10.bas similarity index 100% rename from QBasic tutorial/group1/10.bas rename to QBasic tutorial/Group 1/10.bas diff --git a/QBasic tutorial/group1/11.bas b/QBasic tutorial/Group 1/11.bas similarity index 100% rename from QBasic tutorial/group1/11.bas rename to QBasic tutorial/Group 1/11.bas diff --git a/QBasic tutorial/group1/12.bas b/QBasic tutorial/Group 1/12.bas similarity index 100% rename from QBasic tutorial/group1/12.bas rename to QBasic tutorial/Group 1/12.bas diff --git a/QBasic tutorial/group1/13.bas b/QBasic tutorial/Group 1/13.bas similarity index 100% rename from QBasic tutorial/group1/13.bas rename to QBasic tutorial/Group 1/13.bas diff --git a/QBasic tutorial/group1/15.bas b/QBasic tutorial/Group 1/15.bas similarity index 100% rename from QBasic tutorial/group1/15.bas rename to QBasic tutorial/Group 1/15.bas diff --git a/QBasic tutorial/group1/16.bas b/QBasic tutorial/Group 1/16.bas similarity index 100% rename from QBasic tutorial/group1/16.bas rename to QBasic tutorial/Group 1/16.bas diff --git a/QBasic tutorial/group1/17.bas b/QBasic tutorial/Group 1/17.bas similarity index 100% rename from QBasic tutorial/group1/17.bas rename to QBasic tutorial/Group 1/17.bas diff --git a/QBasic tutorial/group1/18.bas b/QBasic tutorial/Group 1/18.bas similarity index 100% rename from QBasic tutorial/group1/18.bas rename to QBasic tutorial/Group 1/18.bas diff --git a/QBasic tutorial/group1/19.bas b/QBasic tutorial/Group 1/19.bas similarity index 100% rename from QBasic tutorial/group1/19.bas rename to QBasic tutorial/Group 1/19.bas diff --git a/QBasic tutorial/Group 2/01.bas b/QBasic tutorial/Group 2/01.bas new file mode 100755 index 0000000..d3f31ae --- /dev/null +++ b/QBasic tutorial/Group 2/01.bas @@ -0,0 +1,38 @@ +CLS + +' This program demonstrates how to use the SOUND statement in QuickBasic +' to play tones with varying frequency and duration. + +' Play a sequence of tones with increasing frequency +' Each tone has a fixed duration of 2 time units +PRINT "Playing tones with increasing frequency:" +SOUND 1000, 2 ' Play a tone at 1000 Hz for 2 time units +SOUND 2000, 2 ' Play a tone at 2000 Hz for 2 time units +SOUND 3000, 2 ' Play a tone at 3000 Hz for 2 time units + +' Wait for 10 time units to create a pause +PRINT "Pausing for 10 time units..." +SOUND 0, 10 ' Pause for 10 time units (silence) + +' Play a sequence of tones with a fixed frequency +' Each tone has an increasing duration +PRINT "Playing tones with fixed frequency and increasing length:" +SOUND 1000, 1 ' Play a tone at 1000 Hz for 1 time unit +SOUND 0, 10 ' Pause for 10 time units (silence) + +SOUND 1000, 2 ' Play a tone at 1000 Hz for 2 time units +SOUND 0, 10 ' Pause for 10 time units (silence) + +SOUND 1000, 4 ' Play a tone at 1000 Hz for 4 time units +SOUND 0, 10 ' Pause for 10 time units (silence) + +SOUND 1000, 8 ' Play a tone at 1000 Hz for 8 time units +SOUND 0, 10 ' Pause for 10 time units (silence) + +' Notes: +' - The SOUND statement takes two arguments: frequency and duration. +' - Frequency is specified in Hertz (Hz), and duration is specified in time units. +' - A frequency of 0 results in silence, which can be used to create pauses. +' - Time units are not precisely defined by QuickBasic and may vary depending +' on the hardware and system configuration. They provide a relative measure +' for timing musical tones. diff --git a/QBasic tutorial/Group 2/03.bas b/QBasic tutorial/Group 2/03.bas new file mode 100755 index 0000000..c2bba1e --- /dev/null +++ b/QBasic tutorial/Group 2/03.bas @@ -0,0 +1,16 @@ +' This program demonstrates basic user input and string manipulation in QuickBasic. +' It greets the user by name and asks how they are doing, using colors to enhance the output. + +CLS ' Clears the screen to provide a clean start for the program. + +' Prompt the user for their name and store it in a variable called userName$. +INPUT "Hi, what is your name: ", userName$ + +' Set the text color to a bright green (color code 10) for a pleasant visual effect. +COLOR 10 + +' Greet the user by printing "Hello" followed by their name and an exclamation mark. +PRINT "Hello " + userName$ + "!" + +' Ask the user how they are doing by appending their name to the question. +PRINT userName$ + ", how are you?" diff --git a/QBasic tutorial/Group 2/05.bas b/QBasic tutorial/Group 2/05.bas new file mode 100755 index 0000000..031f8d4 --- /dev/null +++ b/QBasic tutorial/Group 2/05.bas @@ -0,0 +1,52 @@ +CLS + +' This program creates a simple text-based box in the console window. +' The user specifies the horizontal and vertical size of the box within +' certain constraints to ensure it fits on the screen. + +' Prompt the user for the horizontal size of the box (between 2 and 79) +INPUT "Enter the Horizontal Size of the Box (2 to 79): ", hs + +' Validate the horizontal size input +WHILE hs < 2 OR hs > 79 + PRINT "Invalid input. Please enter a number between 2 and 79." + INPUT "Enter the Horizontal Size of the Box (2 to 79): ", hs +WEND + +' Prompt the user for the vertical size of the box (between 2 and 23) +INPUT "Enter the Vertical Size of the Box (2 to 23): ", vs + +' Validate the vertical size input +WHILE vs < 2 OR vs > 23 + PRINT "Invalid input. Please enter a number between 2 and 23." + INPUT "Enter the Vertical Size of the Box (2 to 23): ", vs +WEND + +' Draw the top line of the box +FOR i = 1 TO hs + PRINT "#"; +NEXT i +PRINT + +' Draw the middle section of the box +FOR y = 1 TO vs - 2 + ' Print the left side of the box + PRINT "#"; + + ' Print the interior of the box + FOR i = 1 TO hs - 2 + PRINT "."; + NEXT i + + ' Print the right side of the box + PRINT "#" +NEXT y + +' Draw the bottom line of the box +FOR i = 1 TO hs + PRINT "#"; +NEXT i +PRINT + +' The program has finished drawing the box and now ends +END diff --git a/QBasic tutorial/Group 2/07.bas b/QBasic tutorial/Group 2/07.bas new file mode 100755 index 0000000..afe3d37 --- /dev/null +++ b/QBasic tutorial/Group 2/07.bas @@ -0,0 +1,36 @@ +REM This program demonstrates basic input/output and conditional logic in QuickBasic. +REM It prompts the user to enter a number and then evaluates that number +REM with respect to the value 5 using various comparison operators. + +PRINT "Please enter a number:" +INPUT n + +REM Check if the number is less than 5 +IF n < 5 THEN + PRINT "The number you entered is smaller than 5." +END IF + +REM Check if the number is greater than 5 +IF n > 5 THEN + PRINT "The number you entered is greater than 5." +END IF + +REM Check if the number is exactly equal to 5 +IF n = 5 THEN + PRINT "The number you entered is equal to 5." +END IF + +REM Check if the number is less than or equal to 5 +IF n <= 5 THEN + PRINT "The number you entered is 5, or less." +END IF + +REM Check if the number is greater than or equal to 5 +IF n >= 5 THEN + PRINT "The number you entered is 5, or greater." +END IF + +REM Check if the number is not equal to 5 +IF n <> 5 THEN + PRINT "The number you entered is not 5." +END IF diff --git a/QBasic tutorial/Group 2/08.bas b/QBasic tutorial/Group 2/08.bas new file mode 100755 index 0000000..930bea8 --- /dev/null +++ b/QBasic tutorial/Group 2/08.bas @@ -0,0 +1,80 @@ +CLS + +' This program simulates a login prompt for a nuclear rocket control system. +' It asks the user to enter a password and checks if the entered password is correct. +' If the password is incorrect, it prompts the user again. + +' Define a constant for the correct password for better security practices +CONST CorrectPassword = "jerry" + +' Function to display the welcome message +SUB DisplayWelcomeMessage + LOCATE 1, 1 + COLOR 14 + PRINT " ========================================" + PRINT " Welcome to nuclear rocket control system" + PRINT " ========================================" +END SUB + +' Function to display the rocket artwork +SUB DisplayRocketArt + COLOR 10, 1 + PRINT "..............................................................." + PRINT ".....MMMMMM................MM...MMMMMMM.MMMMMM.MMM..MMMMMMM..MM" + PRINT "MMMMMMMMMMMMMMM...MM.M....MMMMM.MM.MMMMMMMMMMMMMMMMMMMMMMM.MM.." + PRINT ".MMMMMMMMMMM.M.....MMM...MM.....MMMMMMMMMMMMMMMMMMMMMM.M......." + PRINT "..MMMMMMMMMMMM..............MMMMMMMMMMMMMMMMMMMMMMMMMM..M ....." + PRINT "....MMMMMMMM...............MMMM..MMMMM.MMMMMMMMMMMMM.MM........" + PRINT ".....MMMMMMM.............MMMMMMMM..MMM..MMMMMM.MMMMM.M........." + PRINT "........MM...............MMMMMMMMMM.M.....MM...........M......." + PRINT "......MMMMMM................MMMMMMM....................M......." + PRINT ".....MMMMMMMM.................MMMMMM....................MMM...." + PRINT "......MMMMMMM.................MMMMM...................MMMMMM..." + PRINT "........MMMMMM..................MM....................MMMMMMM.." + PRINT "..........MMMMM ...........................................MM.." +END SUB + +' Function to play a simple tune +SUB PlayTune + FOR a = 9 TO 23 + SOUND 1.5 ^ a, 3 + NEXT a +END SUB + +' Main program execution starts here +DO + ' Clear the screen and prompt the user for the password + CLS + COLOR 7 + PRINT "Enter password: "; + + ' Temporarily set text color to black to hide the password input + COLOR 0 + INPUT "", UserPassword$ + + ' Restore original text color + COLOR 7 +LOOP UNTIL UserPassword$ = CorrectPassword + +' Clear the screen for the welcome message +CLS + +' Call the function to display the welcome message +DisplayWelcomeMessage + +' Call the function to display the rocket artwork +DisplayRocketArt + +' Locate and display our location with a special color +LOCATE 7, 34 +COLOR 12 + 16 +PRINT "*" + +' Play the simple tune using the sound command +PlayTune + +' Restore default text color +COLOR 7, 0 + +' End of the program +END diff --git a/QBasic tutorial/Group 2/09.bas b/QBasic tutorial/Group 2/09.bas new file mode 100755 index 0000000..2e99357 --- /dev/null +++ b/QBasic tutorial/Group 2/09.bas @@ -0,0 +1,21 @@ +' This program demonstrates the use of string manipulation functions +' in Microsoft QuickBasic. It shows how to extract substrings from a +' given string using the LEFT$ and RIGHT$ functions. + +DEFSTR A-Z ' Define all variables as strings to avoid type mismatches + +' Initialize a string variable with the value "software" +SoftwareName$ = "software" + +' Print the full name of the software +PRINT "Full software name: "; SoftwareName$ + +' Extract and print the first four characters from the left of the string +LEFTPart$ = LEFT$(SoftwareName$, 4) ' Get the leftmost substring +PRINT "Left part (first 4 characters): "; LEFTPart$ + +' Extract and print the last four characters from the right of the string +RIGHTPart$ = RIGHT$(SoftwareName$, 4) ' Get the rightmost substring +PRINT "Right part (last 4 characters): "; RIGHTPart$ + +END ' End of program diff --git a/QBasic tutorial/Group 2/10.bas b/QBasic tutorial/Group 2/10.bas new file mode 100755 index 0000000..5df3e41 --- /dev/null +++ b/QBasic tutorial/Group 2/10.bas @@ -0,0 +1,37 @@ +CLS + +' This program demonstrates basic user input and string manipulation in QuickBasic. + +' Prompt the user to enter some text and store it in a variable called 'userInput$'. +INPUT "Enter some text: ", userInput$ + +' Print the text that the user entered in three different ways: +' 1. Concatenating the prompt with the entered text using the '+' operator. +' 2. Using a comma to separate the prompt from the entered text, which is more efficient. +' 3. Using a colon to print on the same line without a space between the prompt and the input. +PRINT "You entered: " + userInput$ + +' Calculate the length of the entered text using the LEN function. +' Then, print out the length, formatting it as a sentence. +PRINT "Its length is" + STR$(LEN(userInput$)) + " characters." + +' Use a FOR loop to iterate from 1 to the length of the user input. +' In each iteration, extract a substring from the left using the LEFT$ function +' and print it to demonstrate string extraction from the beginning. +FOR index = 1 TO LEN(userInput$) + PRINT "Leftmost " + STR$(index) + " character(s): " + LEFT$(userInput$, index) +NEXT index + +' Print a blank line for better readability of the output. +PRINT + +' Similar to the previous loop, but now we use the RIGHT$ function to extract +' substrings from the right end of the user input, demonstrating string extraction +' from the end of the string. +FOR index = 1 TO LEN(userInput$) + PRINT "Rightmost " + STR$(index) + " character(s): " + RIGHT$(userInput$, index) +NEXT index + +' End of the program. +END + diff --git a/QBasic tutorial/Group 2/12.bas b/QBasic tutorial/Group 2/12.bas new file mode 100755 index 0000000..28b738d --- /dev/null +++ b/QBasic tutorial/Group 2/12.bas @@ -0,0 +1,45 @@ +' This program demonstrates the basics of animation and control flow in QuickBasic. +' It shows a simple text bouncing up and down on the screen, simulating a "jumping" effect. + +' Declare variables with descriptive names to hold the position and movement direction +DIM yPosition AS INTEGER ' Current vertical position of the text +DIM ySpeed AS INTEGER ' Vertical speed (or direction) of the text + +' Initialize the starting position and speed +yPosition = 10 +ySpeed = 1 + +' Main animation loop +DO + ' Clear the screen before drawing the next frame + CLS + + ' Update the vertical position based on the current speed + yPosition = yPosition + ySpeed + + ' Check if the text has hit the top boundary and change direction if it has + IF yPosition > 20 THEN + ySpeed = -1 + ENDIF + + ' Check if the text has hit the bottom boundary and change direction if it has + IF yPosition < 2 THEN + ySpeed = 1 + ENDIF + + ' Set the cursor position to the current vertical position + LOCATE yPosition + + ' Print the "jumping" text at the new position + PRINT "This is jumping text"; + + ' Play a sound with a frequency that varies based on the vertical position + ' The frequency is calculated to give an audible effect as the text jumps + SOUND yPosition * 200 + 100, 1 + + ' Pause briefly before drawing the next frame (adjust this value for faster or slower animation) + DELAY 0.1 +LOOP + +' Note: The program will run indefinitely due to the DO LOOP structure. +' To stop the program, you can press Ctrl+Break on most systems. diff --git a/QBasic tutorial/Group 2/13.bas b/QBasic tutorial/Group 2/13.bas new file mode 100755 index 0000000..c7c507a --- /dev/null +++ b/QBasic tutorial/Group 2/13.bas @@ -0,0 +1,54 @@ +' This program demonstrates basic animation and boundary checking in QuickBasic. +' It simulates a simple ball bouncing around the screen. + +CLS ' Clear the screen before starting the animation + +' Initialize variables representing the ball's position and velocity +DIM x AS INTEGER ' Ball's X coordinate +DIM y AS INTEGER ' Ball's Y coordinate +DIM xs AS INTEGER ' Ball's speed in the X direction +DIM ys AS INTEGER ' Ball's speed in the Y direction + +x = 12 ' Initial X position of the ball +y = 7 ' Initial Y position of the ball +xs = 1 ' Initial velocity in the X direction (rightward) +ys = 1 ' Initial velocity in the Y direction (downward) + +' Main animation loop +DO + ' Erase the ball at its current position by printing a space + LOCATE y, x: PRINT " "; + + ' Update the ball's position based on its velocities + x = x + xs + y = y + ys + + ' Draw the ball at its new position + LOCATE y, x: PRINT "O"; + + ' Check if the ball hits the right or left boundaries and reverse X velocity + IF x >= 79 THEN + xs = -1 + SOUND 1000, 1 ' Play a sound when hitting the boundary + END IF + IF x <= 1 THEN + xs = 1 + SOUND 1000, 1 ' Play a sound when hitting the boundary + END IF + + ' Check if the ball hits the bottom or top boundaries and reverse Y velocity + IF y >= 22 THEN + ys = -1 + SOUND 1000, 1 ' Play a sound when hitting the boundary + END IF + IF y <= 1 THEN + ys = 1 + SOUND 1000, 1 ' Play a sound when hitting the boundary + END IF + + ' Pause briefly to control the speed of the animation + SOUND 0, 1 +LOOP + +' The program will continue running indefinitely, creating an animated bouncing ball effect + diff --git a/QBasic tutorial/Group 2/14.bas b/QBasic tutorial/Group 2/14.bas new file mode 100755 index 0000000..4a0f1f9 --- /dev/null +++ b/QBasic tutorial/Group 2/14.bas @@ -0,0 +1,54 @@ +' This program demonstrates how to use the SOUND statement in QuickBasic +' to produce different tones when pressing keys "0" through "9". +' It also shows how to exit the program by pressing the Escape key. + +CLS +PRINT "Press keys '0'-'9' for different sounds." +PRINT "Press Esc to exit the program." + +' Start an infinite loop to continuously check for user input +DO + ' Read a single character from the keyboard + a$ = INPUT$(1) + + ' Play a sound corresponding to the key pressed + SELECT CASE a$ + CASE "0" + ' Generate a low-pitched tone + SOUND 1900, 2 + CASE "1" + ' Generate a slightly higher pitched tone + SOUND 1000, 2 + CASE "2" + ' Generate a tone with a frequency of 1100 Hz + SOUND 1100, 2 + CASE "3" + ' Generate a tone with a frequency of 1200 Hz + SOUND 1200, 2 + CASE "4" + ' Generate a tone with a frequency of 1300 Hz + SOUND 1300, 2 + CASE "5" + ' Generate a tone with a frequency of 1400 Hz + SOUND 1400, 2 + CASE "6" + ' Generate a tone with a frequency of 1500 Hz + SOUND 1500, 2 + CASE "7" + ' Generate a high-pitched tone + SOUND 1600, 2 + CASE "8" + ' Generate a very high-pitched tone + SOUND 1700, 2 + CASE "9" + ' Generate the highest pitched tone available + SOUND 1800, 2 + CASE CHR$(27) + ' Check if the Escape key is pressed to exit the program + SYSTEM + CASE ELSE + ' If any other key is pressed, do nothing + END SELECT + + ' Loop indefinitely until the user decides to exit +LOOP diff --git a/QBasic tutorial/Group 2/15.bas b/QBasic tutorial/Group 2/15.bas new file mode 100755 index 0000000..0f8b2b8 --- /dev/null +++ b/QBasic tutorial/Group 2/15.bas @@ -0,0 +1,26 @@ +' This program demonstrates how to use a FOR loop and the CHR$ function +' in QuickBasic to print out characters from the ASCII table. + +CLS ' Clears the screen before printing + +' The FOR loop iterates over ASCII values starting from 32 (space character) +' up to 255, which is beyond the standard ASCII range but includes extended +' ASCII characters in QuickBasic. +FOR a = 32 TO 255 + ' CHR$ function converts an ASCII value to its corresponding character + PRINT " " + CHR$(a); ' Prints each character with a leading space for readability +NEXT a + +' Print two new lines to separate the ASCII table from the greeting message +PRINT +PRINT + +' Greet the user in a friendly manner +' The CHR$(1) represents the Start of Header (SOH) control character, which is +' typically not visible and may be interpreted differently depending on the +' environment. It is used here for demonstration purposes to show how +' non-printable characters can be included in strings. +PRINT "Hi there! " + CHR$(1) + +' End of the program +END diff --git a/QBasic tutorial/Group 2/16.bas b/QBasic tutorial/Group 2/16.bas new file mode 100755 index 0000000..3ff22a5 --- /dev/null +++ b/QBasic tutorial/Group 2/16.bas @@ -0,0 +1,40 @@ +' This program demonstrates how to capture and process keyboard input in QuickBASIC. +' It listens for a key press, then prints out the character and its ASCII code. +' Special keys like Escape, Enter, Backspace, Tabulator, and Space are given custom names. + +CLS ' Clears the screen before starting the program +PRINT "Press any key..." ' Prompts the user to press a key + +' Main loop starts here +DO + ' Capture a single character of input from the user + a$ = INPUT$(1) + + ' Print the pressed key, if it is a printable character (ASCII code > 32) + PRINT "Pressed key was: "; + IF ASC(a$) > 32 THEN + PRINT a$ + END IF + + ' Check for special keys and print their names + SELECT CASE ASC(a$) + CASE 27 ' ASCII code for Escape key + PRINT "Escape" + CASE 13 ' ASCII code for Enter key + PRINT "Enter" + CASE 8 ' ASCII code for Backspace key + PRINT "Backspace" + CASE 9 ' ASCII code for Tabulator key + PRINT "Tabulator" + CASE 32 ' ASCII code for Space key + PRINT "Space" + CASE ELSE + ' If the key is not special, print its ASCII character + IF ASC(a$) > 32 THEN + PRINT a$ + END IF + END SELECT + + ' Print the ASCII code of the pressed key + PRINT "ASCII code is: "; ASC(a$) +LOOP ' Continue listening for more key presses diff --git a/QBasic tutorial/Group 2/17.bas b/QBasic tutorial/Group 2/17.bas new file mode 100755 index 0000000..899390e --- /dev/null +++ b/QBasic tutorial/Group 2/17.bas @@ -0,0 +1,58 @@ +' This program demonstrates how to handle keyboard input in QuickBasic +' and move a character around the screen using the numeric keypad. + +CLS + +' Inform the user about the controls and how to exit the program +PRINT "Use keys 4, 8, 6, 2 for movement, make sure the NumLock is on" +PRINT "ESC to exit" + +' Clear a line for better visibility +PRINT " " + +' Wait for the user to press any key to start +PRINT "Press any key to continue..." +a$ = INPUT$(1) + +' Set the text color to bright yellow +COLOR 14 + +' Initialize the starting position of the character +x = 40 +y = 10 + +' Main loop for handling input and drawing the character +DO + CLS ' Clear the screen before redrawing + + ' Set the cursor position to the current character coordinates + LOCATE y, x + + ' Print the character at the current position + PRINT CHR$(2); ' The semicolon prevents moving to the next line + + ' Read a single character of input without waiting + a$ = INPUT$(1) + + ' Check for movement inputs and update the character's position + SELECT CASE a$ + CASE "4" ' Left arrow + x = x - 1 + CASE "6" ' Right arrow + x = x + 1 + CASE "8" ' Up arrow + y = y - 1 + CASE "2" ' Down arrow + y = y + 1 + CASE CHR$(27) ' Escape key + ' Exit the program + SYSTEM + END SELECT + + ' Prevent the character from going off-screen + IF x < 1 THEN x = 1 + IF x > 80 THEN x = 80 + IF y < 1 THEN y = 1 + IF y > 25 THEN y = 25 + +LOOP ' Continue the main loop indefinitely diff --git a/QBasic tutorial/Group 2/18.bas b/QBasic tutorial/Group 2/18.bas new file mode 100755 index 0000000..9700d82 --- /dev/null +++ b/QBasic tutorial/Group 2/18.bas @@ -0,0 +1,56 @@ +CLS + +' Main program loop starts here +DO + ' Clear the screen and print the menu options + CLS + PRINT "******** Select action: ********" + PRINT " " + PRINT "1 - Exit program" + PRINT "2 - Make a sound" + PRINT "3 - Draw a box" + + ' Prompt the user to enter their choice and store it in variable 'userChoice' + INPUT "Enter your choice (1-3): ", userChoice + + ' Exit the program if the user chooses option 1 + IF userChoice = 1 THEN + PRINT "Exiting program..." + EXIT DO + END IF + + ' Play a sound if the user chooses option 2 + IF userChoice = 2 THEN + ' Generate a sound with a frequency of 2000 Hz for 2 seconds + SOUND 2000, 2 + + ' Draw a box if the user chooses option 3 + ELSEIF userChoice = 3 THEN + ' Outer loop to draw the top and bottom edges of the box + FOR row = 1 TO 15 + ' Inner loop to draw the left and right edges of the box + FOR col = 1 TO 50 + PRINT "#"; + NEXT col + ' Move to the next line after drawing each row + PRINT + NEXT row + + ' Inform the user if they have entered a number greater than 3 + ELSEIF userChoice > 3 THEN + PRINT "Number too large. Please enter a value between 1 and 3." + + ' Inform the user if they have entered a number less than 1 + ELSEIF userChoice < 1 THEN + PRINT "Number too small. Please enter a value between 1 and 3." + END IF + + ' Wait for the user to press a key before continuing + PRINT "Press any key to continue..." + WHILE INKEY$ = "" + ' Do nothing, just wait for a key press + WEND + +LOOP WHILE TRUE + +' End of program diff --git a/QBasic tutorial/group3/00.bas b/QBasic tutorial/Group 3/00.bas similarity index 100% rename from QBasic tutorial/group3/00.bas rename to QBasic tutorial/Group 3/00.bas diff --git a/QBasic tutorial/group3/01.bas b/QBasic tutorial/Group 3/01.bas similarity index 100% rename from QBasic tutorial/group3/01.bas rename to QBasic tutorial/Group 3/01.bas diff --git a/QBasic tutorial/group3/02.bas b/QBasic tutorial/Group 3/02.bas similarity index 100% rename from QBasic tutorial/group3/02.bas rename to QBasic tutorial/Group 3/02.bas diff --git a/QBasic tutorial/group3/03.bas b/QBasic tutorial/Group 3/03.bas similarity index 100% rename from QBasic tutorial/group3/03.bas rename to QBasic tutorial/Group 3/03.bas diff --git a/QBasic tutorial/group3/04.bas b/QBasic tutorial/Group 3/04.bas similarity index 100% rename from QBasic tutorial/group3/04.bas rename to QBasic tutorial/Group 3/04.bas diff --git a/QBasic tutorial/group3/05.bas b/QBasic tutorial/Group 3/05.bas similarity index 100% rename from QBasic tutorial/group3/05.bas rename to QBasic tutorial/Group 3/05.bas diff --git a/QBasic tutorial/group3/06.bas b/QBasic tutorial/Group 3/06.bas similarity index 100% rename from QBasic tutorial/group3/06.bas rename to QBasic tutorial/Group 3/06.bas diff --git a/QBasic tutorial/group3/07.bas b/QBasic tutorial/Group 3/07.bas similarity index 100% rename from QBasic tutorial/group3/07.bas rename to QBasic tutorial/Group 3/07.bas diff --git a/QBasic tutorial/group3/08.bas b/QBasic tutorial/Group 3/08.bas similarity index 100% rename from QBasic tutorial/group3/08.bas rename to QBasic tutorial/Group 3/08.bas diff --git a/QBasic tutorial/group3/09.bas b/QBasic tutorial/Group 3/09.bas similarity index 100% rename from QBasic tutorial/group3/09.bas rename to QBasic tutorial/Group 3/09.bas diff --git a/QBasic tutorial/group3/10.bas b/QBasic tutorial/Group 3/10.bas similarity index 100% rename from QBasic tutorial/group3/10.bas rename to QBasic tutorial/Group 3/10.bas diff --git a/QBasic tutorial/group3/11.bas b/QBasic tutorial/Group 3/11.bas similarity index 100% rename from QBasic tutorial/group3/11.bas rename to QBasic tutorial/Group 3/11.bas diff --git a/QBasic tutorial/group2/01.bas b/QBasic tutorial/group2/01.bas deleted file mode 100755 index 39b091d..0000000 --- a/QBasic tutorial/group2/01.bas +++ /dev/null @@ -1,20 +0,0 @@ -CLS - -' incareasing frequancy; suurenev sagedus; uvelicevajusijesja xastota -SOUND 1000, 2 -SOUND 2000, 2 -SOUND 3000, 2 - -' incareasing length; suurenev kestvus; uvelicevajusijesja dlitelnost -SOUND 0, 10 -SOUND 1000, 1 - -SOUND 0, 10 -SOUND 1000, 2 - -SOUND 0, 10 -SOUND 1000, 4 - -SOUND 0, 10 -SOUND 1000, 8 - diff --git a/QBasic tutorial/group2/02.bas b/QBasic tutorial/group2/02.bas deleted file mode 100755 index 39b2c4e..0000000 --- a/QBasic tutorial/group2/02.bas +++ /dev/null @@ -1,14 +0,0 @@ -1 -s = s + 1 ' speed -PRINT s; "x" - -FOR a = 100 TO 1000 STEP s - SOUND a, .1 -NEXT a - -FOR a = 1000 TO 100 STEP -s - SOUND a, .1 -NEXT a - -GOTO 1 - diff --git a/QBasic tutorial/group2/03.bas b/QBasic tutorial/group2/03.bas deleted file mode 100755 index f5de99b..0000000 --- a/QBasic tutorial/group2/03.bas +++ /dev/null @@ -1,7 +0,0 @@ -CLS - -INPUT "Hi, what is your name: ", a$ -COLOR 10 -PRINT "Hello " + a$ + " !" -PRINT a$ + " how are you?" - diff --git a/QBasic tutorial/group2/04.bas b/QBasic tutorial/group2/04.bas deleted file mode 100755 index a428f1e..0000000 --- a/QBasic tutorial/group2/04.bas +++ /dev/null @@ -1,11 +0,0 @@ -CLS - -a$ = "-two-" -PRINT a$ - -a$ = a$ + "three" -PRINT a$ - -a$ = "one" + a$ -PRINT a$ - diff --git a/QBasic tutorial/group2/05.bas b/QBasic tutorial/group2/05.bas deleted file mode 100755 index e9623c6..0000000 --- a/QBasic tutorial/group2/05.bas +++ /dev/null @@ -1,24 +0,0 @@ -CLS - -INPUT "Horisontal size (2 to 79):", hs -INPUT "Vertical size (2 to 23):", vs - - -FOR i = 1 TO hs ' make top of the box - PRINT "#"; -NEXT i -PRINT - -FOR y = 1 TO vs - 2 ' make main box area - PRINT "#"; - FOR i = 1 TO hs - 2 - PRINT "."; - NEXT i - PRINT "#" -NEXT y - -FOR i = 1 TO hs ' make last line of the box - PRINT "#"; -NEXT i -PRINT - diff --git a/QBasic tutorial/group2/06.bas b/QBasic tutorial/group2/06.bas deleted file mode 100755 index d7f192d..0000000 --- a/QBasic tutorial/group2/06.bas +++ /dev/null @@ -1,5 +0,0 @@ -' several commans may be at the single line, when separated by colon. - -1 a = a + 1: PRINT a; "x 7 ="; a * 7: IF a < 10 THEN GOTO 1 - - diff --git a/QBasic tutorial/group2/07.bas b/QBasic tutorial/group2/07.bas deleted file mode 100755 index 4a56ab1..0000000 --- a/QBasic tutorial/group2/07.bas +++ /dev/null @@ -1,10 +0,0 @@ -INPUT "enter a number:", n - -IF n < 5 THEN PRINT "this number is smaller than 5" -IF n > 5 THEN PRINT "this number is greater than 5" -IF n = 5 THEN PRINT "this number is equal to 5" -IF n <= 5 THEN PRINT "this number is 5, or less" -IF n >= 5 THEN PRINT "this number is 5, or greater" -IF n <> 5 THEN PRINT "this number is not 5" - - diff --git a/QBasic tutorial/group2/08.bas b/QBasic tutorial/group2/08.bas deleted file mode 100755 index 7ec2867..0000000 --- a/QBasic tutorial/group2/08.bas +++ /dev/null @@ -1,43 +0,0 @@ -CLS - -1 -PRINT "enter password:"; -COLOR 0 ' set temprorarily text color to 0, to hide password - ' black (0) text is invisivle on black backround. -INPUT "", a$ -COLOR 7 ' restore to original text color - -IF a$ <> "jerry" THEN PRINT "wrong password!": GOTO 1 - - -CLS -LOCATE 1, 1 -COLOR 14 -PRINT " ========================================" -PRINT " Welcome to nuclear rocket control system" -PRINT " ========================================" -COLOR 10, 1 -PRINT "..............................................................." -PRINT ".....MMMMMM................MM...MMMMMMM.MMMMMM.MMM..MMMMMMM..MM" -PRINT "MMMMMMMMMMMMMMM...MM.M....MMMMM.MM.MMMMMMMMMMMMMMMMMMMMMMM.MM.." -PRINT ".MMMMMMMMMMM.M.....MMM...MM.....MMMMMMMMMMMMMMMMMMMMMM.M......." -PRINT "..MMMMMMMMMMMM..............MMMMMMMMMMMMMMMMMMMMMMMM..M ......." -PRINT "....MMMMMMMM...............MMMM..MMMMM.MMMMMMMMMMMMM.MM........" -PRINT ".....MMMMMMM.............MMMMMMMM..MMM..MMMMMM.MMMMM.M........." -PRINT "........MM...............MMMMMMMMMM.M.....MM...........M......." -PRINT "......MMMMMM................MMMMMMM....................M......." -PRINT ".....MMMMMMMM.................MMMMMM....................MMM...." -PRINT "......MMMMMMM.................MMMMM...................MMMMMM..." -PRINT "........MMMMMM..................MM....................MMMMMMM.." -PRINT "..........MMMMM ...........................................MM.." - -LOCATE 7, 34 ' display our location -COLOR 12 + 16 -PRINT "*" - -FOR a = 9 TO 23 ' play tune - SOUND 1.5 ^ a, 3 -NEXT a - -COLOR 7, 0 ' restore default color - diff --git a/QBasic tutorial/group2/09.bas b/QBasic tutorial/group2/09.bas deleted file mode 100755 index c155bb9..0000000 --- a/QBasic tutorial/group2/09.bas +++ /dev/null @@ -1,6 +0,0 @@ -a$ = "software" - -PRINT a$ -PRINT LEFT$(a$, 4) ' get left piece -PRINT RIGHT$(a$, 4) ' get right piece - diff --git a/QBasic tutorial/group2/10.bas b/QBasic tutorial/group2/10.bas deleted file mode 100755 index 0cf930b..0000000 --- a/QBasic tutorial/group2/10.bas +++ /dev/null @@ -1,21 +0,0 @@ -CLS - -INPUT "Enter some text:", t$ - -PRINT "You entered:" + t$ -PRINT "You entered:"; t$ -PRINT "You entered:", t$ - - -PRINT "It's length is"; LEN(t$); "letters." - -FOR i = 1 TO LEN(t$) ' get text from left - PRINT LEFT$(t$, i) -NEXT i - -PRINT - -FOR i = 1 TO LEN(t$) ' get text from right - PRINT RIGHT$(t$, i) -NEXT i - diff --git a/QBasic tutorial/group2/11.bas b/QBasic tutorial/group2/11.bas deleted file mode 100755 index 0831a84..0000000 --- a/QBasic tutorial/group2/11.bas +++ /dev/null @@ -1,10 +0,0 @@ -CLS - -INPUT "Enter some text:", t$ - -FOR i = 1 TO LEN(t$) - a$ = LEFT$(t$, i) - b$ = RIGHT$(a$, 1) - PRINT "letter:"; b$ -NEXT i - diff --git a/QBasic tutorial/group2/12.bas b/QBasic tutorial/group2/12.bas deleted file mode 100755 index 9e6ca8c..0000000 --- a/QBasic tutorial/group2/12.bas +++ /dev/null @@ -1,13 +0,0 @@ -y = 10 -ys = 1 - -1 -CLS -y = y + ys -IF y > 20 THEN ys = -1 -IF y < 2 THEN ys = 1 -LOCATE y -PRINT "This is jumping text" -SOUND y * 200 + 100, 1 -GOTO 1 - diff --git a/QBasic tutorial/group2/13.bas b/QBasic tutorial/group2/13.bas deleted file mode 100755 index 38cf3c7..0000000 --- a/QBasic tutorial/group2/13.bas +++ /dev/null @@ -1,27 +0,0 @@ -CLS - -x = 12 ' ball X coordinate -y = 7 ' ball Y coordinate -xs = 1 ' speed on X direction -ys = 1 ' speed on Y direction - -1 -LOCATE y, x ' erase ball -PRINT " " - -x = x + xs ' calculate new ball coordinates -y = y + ys - -LOCATE y, x ' draw ball -PRINT "O" - - -IF x > 79 THEN xs = -1: SOUND 1000, 1 ' check for boundaries -IF x < 2 THEN xs = 1: SOUND 1000, 1 - -IF y > 22 THEN ys = -1: SOUND 1000, 1 -IF y < 2 THEN ys = 1: SOUND 1000, 1 - -SOUND 0, 1 ' wait -GOTO 1 - diff --git a/QBasic tutorial/group2/14.bas b/QBasic tutorial/group2/14.bas deleted file mode 100755 index 14f4695..0000000 --- a/QBasic tutorial/group2/14.bas +++ /dev/null @@ -1,21 +0,0 @@ -CLS -PRINT "press keys 0-9, for sound" -PRINT "press ESC to exit program" - -1 -a$ = INPUT$(1) - -IF a$ = "1" THEN SOUND 1000, 2 -IF a$ = "2" THEN SOUND 1100, 2 -IF a$ = "3" THEN SOUND 1200, 2 -IF a$ = "4" THEN SOUND 1300, 2 -IF a$ = "5" THEN SOUND 1400, 2 -IF a$ = "6" THEN SOUND 1500, 2 -IF a$ = "7" THEN SOUND 1600, 2 -IF a$ = "8" THEN SOUND 1700, 2 -IF a$ = "9" THEN SOUND 1800, 2 -IF a$ = "0" THEN SOUND 1900, 2 -IF a$ = CHR$(27) THEN SYSTEM ' 27 = ESCape key code - -GOTO 1 - diff --git a/QBasic tutorial/group2/15.bas b/QBasic tutorial/group2/15.bas deleted file mode 100755 index f5121f6..0000000 --- a/QBasic tutorial/group2/15.bas +++ /dev/null @@ -1,10 +0,0 @@ -CLS - -FOR a = 32 TO 255 -PRINT " " + CHR$(a); -NEXT a - -PRINT " " -PRINT " " -PRINT "Hi there! " + CHR$(1) - diff --git a/QBasic tutorial/group2/16.bas b/QBasic tutorial/group2/16.bas deleted file mode 100755 index 59bce8a..0000000 --- a/QBasic tutorial/group2/16.bas +++ /dev/null @@ -1,19 +0,0 @@ -CLS -PRINT "Press any key..." - -1 -a$ = INPUT$(1) - -PRINT "pressed key was: "; - -IF ASC(a$) > 32 THEN PRINT a$ - -IF a$ = CHR$(27) THEN PRINT "Escape" -IF a$ = CHR$(13) THEN PRINT "Enter" -IF a$ = CHR$(8) THEN PRINT "Backspace" -IF a$ = CHR$(9) THEN PRINT "Tabulator" -IF a$ = " " THEN PRINT "Space" - -PRINT "ASCII code is: "; ASC(a$) -GOTO 1 - diff --git a/QBasic tutorial/group2/17.bas b/QBasic tutorial/group2/17.bas deleted file mode 100755 index ee9a18c..0000000 --- a/QBasic tutorial/group2/17.bas +++ /dev/null @@ -1,22 +0,0 @@ -CLS -PRINT "Use keys 4, 8, 6, 2 for control, make sure the NumLock is on" -PRINT "ESC to exit" -PRINT " " -PRINT "Press any key to continue..." -a$ = INPUT$(1) - -COLOR 14 -x = 40 -y = 10 -1 -CLS -LOCATE y, x -PRINT CHR$(2) -a$ = INPUT$(1) -IF a$ = "4" THEN x = x - 1 -IF a$ = "6" THEN x = x + 1 -IF a$ = "8" THEN y = y - 1 -IF a$ = "2" THEN y = y + 1 -IF a$ = CHR$(27) THEN SYSTEM -GOTO 1 - diff --git a/QBasic tutorial/group2/18.bas b/QBasic tutorial/group2/18.bas deleted file mode 100755 index 391a349..0000000 --- a/QBasic tutorial/group2/18.bas +++ /dev/null @@ -1,28 +0,0 @@ -CLS -1 - -PRINT "******** Select action: ********" -PRINT " " -PRINT "1 - exit program" -PRINT "2 - make a sound" -PRINT "3 - draw box" - -INPUT "", a - -IF a = 1 THEN SYSTEM - -IF a = 2 THEN SOUND 2000, 2 - -IF a = 3 THEN - FOR c = 1 TO 15 - FOR b = 1 TO 50 - PRINT "#"; - NEXT b - PRINT " " - NEXT c -END IF - -IF a > 3 THEN PRINT "Number too large" -IF a < 1 THEN PRINT "Number too small" -GOTO 1 - diff --git a/index.org b/index.org index b5c34e9..8383361 100644 --- a/index.org +++ b/index.org @@ -147,6 +147,14 @@ appear small. To make it bigger: 3. Save the changes and restart DOSBox for the configuration to take effect. +*** Exit mouse capture + +DOSBox detects when a game uses mouse control. When you click on the +screen, it should get locked (confined to the DOSBox window) and work. + +To release mouse lock, press: +: CTRL-F10 + * Applications There are lot of applications. Few examples: -- 2.20.1