Copy Link
Add to Bookmark
Report
Qbasic Developers Forum issue 4
-=-=-=-=-=-=-=-=-=-=-=-=-=-
= Qbasic =
- Developers -
= Forum =
-=-=-=-=-=-=-=-=-=-=-=-=-=-
Issue IV July 1999
Qbasic Developers Forum is written by a human, for humans. I know how
tough learning advanced topics for Qbasic can be, let alone if it is in
techno-babble. So In this Newsletter you will learn how to do really cool stuff
in Qbasic, QuickBasic, and maybe I'll throw in some GW-Basic or Basica to please
you old timers! You can get on the QDF mailing list by emailing me the following
address, with "Qbasic Developers Forum" as the subject. In the body include how
you heard about QDF, and if you got it on the internet, what was the site
address.
LordAcidus@aol.com
Internet Sites that have the QDF:
(run by a great friend)
http://www.mindspring.com/~Quartzzk/Billy
(I have no control over the following)
http://members.tripod.com/the_void_/
http://www.geocities.com/TimesSquare/arena/5451/Qbasic
and the original QDF site which started the mailing list:
http://www.alphalink.com.au/~alain/qbas/
************************************
*The FAT (Feature Allocation Table)*
************************************
(editorials)
-From the Acid Pool
(features)
-Big Brother is puzzled by you
How encryption works and how to make UNBREAKABLE code
-"My mind is going..."
Passing variables to other programs through RAM
-Warping the PC
A list of modifications to do with you PC
-School time fun
messing with the school's network
(every Issue)
-Face Lift
Ending the "Redo from Start" message
-Quick tips
Finally a way to cope with Qbasic TIME statement
-----------------
From the AcidPool
-----------------
Hello folks and welcome to Issue IV. Damn, after such a serious issue as
the last one, you will find this an amusing change of pace. I have some great
stuff in this issue.
Security is a big thing on the internet today. Mcaffee and Norton make
billions on there Anti-virus software. With all the online shopping sites such
as Amazon, Dell, and every other company out there, Credit card numbers are
flying all over the place. I am hearing constantly in the news today all about
those "deadly hackers." I make a whole lot of fun of pop cultures view of them.
And speaking of hacking, I have an article describing the various holes in
Novell and Microsoft. This newsletter is about programming, I know, and I have
kept it clean. I am just going to share my experience with you. I don't believe
in putting in disclaimers and all that shit. When AOL refused to post me very
first newsletter, and I went back and removed anything that might have been
risky from it and yet they still refused it. I decided I would write this
newsletter any damn way I wanted, and fuck you if you want me to stop.
This issue also is a paradox, because not only do I tell you how to
"liberate" the information on secure PCs, but I also have an article of how
encryption works, and use PGP (pretty good privacy) type codes. PGP is rumored
to be the only encryption software that can't be broke by the NSA.
I am gearing this newsletter to have a broader scope. It will mainly
contain Qbasic coding hints, but will also have mixed in every now and then
amusing articles (Boolean Hell, Issue II) and explore new concepts such as
encryption, compression, and even pop culture tidbits.
The mailing list is getting bigger and bigger. It is read by people all
over the world. Let me include to you an email from Elaina Neville:
"I just wanted to thank and congratulate you on a fine tutorial for
Qbasic. I am an IT teacher in Orange Australia. I was given the job of teaching
programming in Qbasic to beginners. I have never used Qbasic myself, but have
programmed in Pascal, and VBasic mostly. I hunted the web for something to help
me and my students. Your site (Editors note: I have know Idea what site this is)
was the best I found and my students used it as an extra resource. It was
simple, interesting and covered the basics very well.
Thank you for providing it.
A further search yesterday for simple programs to use in their test proved
fruitless. I have included some of the files I have used in their test (I had to
create them) You may like to add them somewhere or create similar simple
examples for students to reference.
Thanks again,
Elaina Neville
PS feel free to change or correct any mistakes I have made. I may have to
teach it again.
THANK YOU ELAINA
I am currently looking for someone to help me develop an "Official" QDF
homepage. A guy named Mike was helping me, and has since dropped off the face of
the earth. There are several sites now to get my newsletter, and I encourage
anyone who has a page to post it. I plan to swamp those dumb fucks who, after I
wrote issue one, refused to even email me back about posting it. So Mallard,
FUCK YOU! Anyone who wants to post it, please email me with your site's address,
so I can advertise it in QDF, and send you regular updates.
I'm going to take the time and plug some software that helps me out. This
isn't me selling out, rather, I wish to tell you of things to help you out,
which are all free.
-Netscape Communicator
-Winzip 7.0 and crack
-RZSplit
-Norton Anti-virus Trial version and crack
Enjoy the issue.
-----------------------------
Big Brother is puzzled by you
-----------------------------
ohhhh... we're all a little closer thanks to the internet. Or so
everyone tells me. Personally, I don't want to be any closer to the 50 year
old single white male child pornography Photographers out there in all the AOL
chat rooms, or on IRC. I also am sick of the media saying how about all
those dangerous "hackers" out there. OH GOD NOT THE HACKERS! THEY MIGHT DO
SOMETHING TO ME! AAHHHH, TECHNOLOGY IS EVIL, FLEE TO THE BADLANDS, THE EVIL
HACKERS WILL DESTROY US ALL!!!!!!!!!!
Yes, they tend to blow things out of proportion. However, security is
an important thing. But how do you get good encryption software, that is east
to use, and IMPOSSIBLE to break? Simple, make your own.
Now listen up and listen good. I had to self-teach myself all this
stuff. I didn't even have books on the subject, so between sleeping in AP
economics, and looking at Breasts in Latin, I went over the basics of
Encoding/decoding in my head. First of all, you must have a program. This
program can take a file, use some magic wand, and convert the file into a big
mess. Then you take the mess, and store it/send it/print it whatever. When
you decode it, the program has to use the same magic process and revert the
file to its original state.
Granted "magic" isn't a very good definition of what the program
does. Encoding a file is a very simple idea. What the program does is to
read through the file, and take each character, and change it based on what
is called the key. Lets say the character being read is "A" which is ASCII
code 65. Ok, the program takes 65 and adds 9 to it (9 being the key). The new
value is 74, which is the ASCII code for "J". "J" would then be written to
the file.
Key%=9
Char$="A"
NewChar$=Chr$(ASC(Char$)+key%)
print NewChar$ 'displays "J"
Ok, if that's how it works, then I looked at it from the other end.
How would I break a coded file. Yes, I have broken files before, and its is
pretty easy. It is easy because each character changed by the same value, as
in the case of our example, it was 7. I have a program on my Computer that I
wrote called "Simple_Break.bas" It just reads through an encoded file, and
tries different numbers as keys. It then looks at the file and looks for the
words "the" "and" "is" "was" "it" and other common words that I got out of
the 1996 world Almanac. Granted this doesn't work on .EXE files, but it is
very good a breaking text files. BTW, I call breaking encoded files breaking.
"Cracking" is disabling a copyright protection of password on a game, common
in WareZ.
So, since you don't want a program that has the same key for each
character, what do you do? Well, I soon thought that every key, must be
different. Like, you type in a password, like "dog", and the computer takes
each letter, and matches it with a letter in the key. It takes the ASCII code
of the original character, add the ASCII code the letter of the key, and stores
the result. If the result is greater than 255, it loops around to 255 -
NewCode%. The next letter is moved to, and the next key letter is used, and
the process repeats. When the last letter of the key is used, it loops back
around to the first letter of the key. This is easier to show
then tell. We will encode the sentence "Qbasic will never die!" with the key
"dog" (IF you are using a NOTEPAD to view this you will not see the real
ASCII character, because Windows can't display some of them. Use "EDIT" to
see the real stuff)
Original: Qbasic will never die
key : dogdogdogdogdogdogdog
After : `ExOE,`DDUOOOY OEOId
First notice that the key "dog" is only 3 letters long. Since this
is a lot shorter then "Qbasic will never die", the key is repeated when it
gets to the end. Also notice that the space after "Qbasic" is represented by
the "," character. Yet the space after "will" is represented by "O" Do you
realize how great that. Unless you know the EXACT key letter by letter, there
is no way to crack it.
Now notice what happen to the same sentence if we use "Happyness" as
the key: ( Yes I know it is Happiness, but we are going to use Happyness)
Original: Qbasic will never die
Key : HappynessHappynessHap
After : (tm)AaY...^s'I__,E+"EO
COMPLETELY DIFFERENT ENCODING! See what I mean, it is incredible.
this is IMPOSSIBLE to break except under 1 condition. The breaker knows what
the very beginning of the file should look like. For example, if you encoded
this issue of QDF, I could break it, because I know the first line is ALWAYS
"-=-=-=-=-=-=-=-=-=-=-=-=-=-" Since I know what the beginning of the file
looks like before it was encoded, and I know what the file looks like
encoded, by working backward, I could get the key. Only under this one
condition could I figure out the key.
The following is the code of my Encoder/decoder, so feel free to use
it. Remember, there is really no limit to your key. Make it a line from your
favorite song. Make it nonsense, make it anything you want. I use this
program a lot when dealing with credit card numbers when I email them to
friends. Enjoy!
'*******************************************************Menu
CLS
PRINT "/'cidus Enigma machine"
PRINT "1- Encode file"
PRINT "2- Decode file"
INPUT a%
IF a% = 2 THEN GOTO de
'***********************************************************encoder
CLS
INPUT "Name for file to encode:", file$
OPEN file$ FOR BINARY AS #1
OPEN "filedump.dmp" FOR OUTPUT AS #2
CLOSE #2
KILL "filedump.dmp"
OPEN "Filedump.dmp" FOR BINARY AS #2
InCharByte$ = SPACE$(1)
INPUT "Enter Key:", key$
Keylocation% = 1
LenofKey% = LEN(key$)
LOCATE 4: PRINT "Bytes to process"; LOF(1)
ByteCount% = 0
DO
LOCATE 5: PRINT "Bytes Number:"; ByteCount%
GET 1, , InCharByte$
ByteCount% = ByteCount% + 1
AltAsc% = ASC(InCharByte$) + ASC(MID$(key$, Keylocation%, 1))
IF AltAsc% > 254 THEN AltAsc% = AltAsc% - 254
Keylocation% = Keylocation% + 1
IF Keylocation% > LenofKey% THEN Keylocation% = 1
PlaceMe$ = CHR$(AltAsc%)
PUT 2, , PlaceMe$
LOOP UNTIL EOF(1)
CLOSE
KILL file$
NAME "filedump.dmp" AS file$
END
'***********************************************Decode
de:
INPUT "File to decode:", file$
INPUT "Enter Key:", key$
OPEN file$ FOR BINARY AS #1
OPEN "filedump.dmp" FOR OUTPUT AS #2
CLOSE #2
KILL "filedump.dmp"
OPEN "Filedump.dmp" FOR BINARY AS #2
InCharByte$ = SPACE$(1)
Keylocation% = 1
LenofKey% = LEN(key$)
LOCATE 4: PRINT "Bytes to process"; LOF(1)
ByteCount% = 0
DO
LOCATE 5: PRINT "Bytes Number:"; ByteCount%
GET 1, , InCharByte$
ByteCount% = ByteCount% + 1
AltAsc% = ASC(InCharByte$) - ASC(MID$(key$, Keylocation%, 1))
Keylocation% = Keylocation% + 1
IF Keylocation% > LenofKey% THEN Keylocation% = 1
IF AltAsc% < 1 THEN AltAsc% = 254 + AltAsc%
PlaceMe$ = CHR$(AltAsc%)
PUT 2, , PlaceMe$
LOOP UNTIL EOF(1)
CLOSE
KILL file$
NAME "filedump.dmp" AS file$
END
---------------------
"My mind is going..."
---------------------
Don't you wish you had a place to dump information to in your
program. You want a place where you can store data temporarily. A place
that other programs can read it. Well you have 3 options: Dump it too a
disk, uses COMMONs and CHAINs, or dump it to memory
Now, dumping it to a disk isn't so bad. Sometimes, there is no way
around this. Windows 3.x, 95, and 98 do it. You can store as much data
on a disk as there is space. There is just one big problem: Disk access is the
slowest thing you can do on a computer. Your computer moves around at the
"speed" of electricity inside you computer (what the speed of electricity is,
I have no idea, but it is really damn fast, in fact speed isn't a good word
for it, but this will make it easier to understand) Know, when the computer
has to get data from a disk, it must PHYSICIALY spin the platters in of the
disk and then move the read/write head to a part of the disk then start
reading the information very slowly. This is the equivalent of going 85mph
on the highway, and then suddenly have slam on your brakes and precede at
the rate of my Grandmother's walker!
COMMONs and CHAINs are not that great. Sure they allow variables to
be pasted to other programs, but you can't use CHAIN or COMMON if you compile
the program. You will need to use RAM
OH MY GOD, RAM! I was so scared of RAM. Nobody could tell me exactly
what it was, and why you needed it, or how it worked. It a little magic
gnome that lived in your computer and made everything better. Here is an analogy
my brother told me many years ago. Think of the computer as a B- student. He can
read and read all day, but only remembers so much. Know he read a book. Later
when asked about the book, he can tell you only so much about it, but if you
want a lot of information, he will have to go back and re-read parts of the
book. Now think of the "book" as your Hard disk. When you run a program, say,
Quake II, the computer reads the program from the disk and "remembers" it in.
RAM. When the program needs something, like a graphic or a sound. The computer
first checks its RAM to see if it "remembers" it. If the computer doesn't have
the WAV file of a fiend ripping you open, it will then go back to your hard disk
and re-read that part into RAM. This is why adding more RAM gives you the
largest performance increases. The less time the computer speeds re-reading
stuff, the more time it can devote to running the program.
But wait, RAM is a busy place. Windows uses it to Multitask. DOS
is loaded into it. Also, memory managers like QEMM shove stuff in
different locations on different computers. You only need to worry about memory
managers on MS-DOS or WIN 3.x systems. But how do you find a little space and
RAM to crawl inside and claim that land for Spain?
There are a few ways to do this, but it depends on what system you are
using. If you are using a Windows 95, just use DEF SEG = 0. First run a Dos
prompt, and then run Qbasic, as long as you don't close the DOS prompt, Win95
auto-restricts a certain area in memory for you, and you don't have to worry
about other programs running using it up. If the program is a compiled program,
you might want to consider re-starting your computer in MS-DOS mode, or
launching it from a DOS prompt.
However, if you are using Win 3.x, or you are not sure what systems you
program will be run on, it is safer to use the following method. Editor's note.
I started writing this article before I wrote Issue 3. I did touch on Video
memory briefly in issue 3, but will repeat it here.
I don't want to go into RAM workings, XMS,EMS, and other hard
stuff like, because it is very confusing. But I'll tell you this. Back
in the day of XT's, IBM need a place in RAM, 8k to be exact, to use as
the screen buffer for BIOS. Well, there are monochromatic monitors, and
there are color monitors, they thought. We'll just set aside 4k for each
to use. The did 4k because at that time, screen could only have a max of
25 rows by 80 columns. (25*80=4000) And since everything must be in
hexadecimal, which is short for binary, it must be in a power of 2 (4096
instead of 4000)
So, IBM made 2 little places in memory that are 4k (4096) in size.
But wait, if you are using a color monitor, what happens to the 4k of
RAM for Monochrome Monitors? Jack squat. It just sits there, wanting to
be loved. Now, the memory addresses of the 2 4k blocks are as follows.
Mono &HB000 (&H just tells basic it is in HEX number system)
Color &HB800
There is one and only one exception to this rule, Hercules Video.
For thoughts of you who don't know, Hercules has a graphics card you
could by that let monochrome monitors display graphics. It was neato, but
wasn't supported in BIOS, so you had to load a TSR (MSHerc.com,
QBHERC.com, or HercDrv.com) that did the graphic. Because it did have this
BIOS support, Hercules uses BOTH 4k screen buffers.
To load stuff into RAM, use will you the following Statements and
functions: FOR, LEN, ASC, CHR$, POKE, PEEK, and DEF SEG
Now, this took me while to figure out, but here it is. You use DEF SEG to
go to an address in RAM. An Address is a little space (1 byte) where stuff
is stored. Once you get to an address, you use PEEK and POKE to read and
write data. Now remember the computer works in BINARY, and a more complex
form of that is HEXIDECMAL. All the addresses in RAM are in hex. In BASIC,
hex numbers are represented by an "&H". Here is an example:
DEF SEG=&H300 ' Heah computer, Move me to address &H300
a = PEEK(0) ' Read the byte at address &H300 + 0, and save it as "a"
b = PEEK(1) ' Read the byte a address &H301 (&H300+1); save as "b"
PutMeInMemory = 27
POKE(0), PutMeInMemory
There is in memory. To retrieve it, use PEEK. Now, why would you want to use
PEEK and POKE so much you ask. Since they directly access and assign memory
addresses, PEEK and POKE make Qbasic very powerful. You can use these areas of
memory that I have shown you to POKE in data, and then PEEK it later, or by
another program. If you need to store a lot of information to pass to another
program (such as our task swapping OS we made in Issue 3) I would POKE a string
of ASCII characters that are the filename and directory of a file that contains
all the information you need. Such as:
Placeme$="C:\AcidOS\OsSet.ini"
For x=1 to len(placeme$)
Poke(x),asc(mid$(Placeme$,x,1)
Next
Enjoy!
---------------
Warping the CPU
---------------
The PC speaker is an interesting thing. It is great to have. It
Tells us when MS-DOS's keyboard buffer is full, plays noises in Qbasic,
and other neat stuff. There is just one problem, IT IS LOUD AS HELL! There
are several adjustments you can make with you PC speaker. Now, granted you
COULD go spend $12.99 a piece at Radio Shack (which is owned by Tandy, So I
guess they got out of the crappy computer business, and now to cope with
their anger, harass you by over charging you for small parts),
or you can have alot of fun "modifying" your computer.
Here are some things you can do with just your speaker (or, as I
have done, all of them)
1-Add an ON/OFF switch
2-Add a volume switch
3-Add a headphone jack
4-Pipe in music
5-Wire it to your stereo
ADD A ON/OFF SWITCH
Get:
-knife
-hacksaw (optional)
-light switch
-electrical tape
-copper wire
This is the easiest add-on to your computer. Just go to your local
hardware store, and buy some electrical tape, a light switch and some wire.
Take the hacksaw and saw off the 2 end of the light switch so you are left
with just the switch part. It is about an inch and a half long. Find where
you speaker attaches to your mother board. There should be 2 wires that go
into a little black think that fits over 4 pins (it might be 2 on some
mother boards). The mother board might have "SPKR" or "SPEAKER" printed
under the set of pins, but it with probably say "J-18" or something like
that. Disconnect the speaker.
Go about 2 inches up the wire from the black pin holder thingy and
cut ONE of the wires (it doesn't matter which one). Next use some of your
extra wire and connect one end of the cut wire with one of the screws on the
side of the light switch. The wire length depends on where your going to put
the switch. This is where the fun comes in. If you have a tower case. Then
you can drill a hole in one of the unused drive covers and glue the back of
the light switch to the outside. Run the wires through this hole (about the
size of a penny) and connect it). If you have a desktop case, be prepared
for some work. You can either drill a hole in the front of the case, or just
use alot of wire and run them out the back of the computer through one of
the unused expansion slots.
Ok, so you have one end of the cut wire attached to an extra piece
of wire which runs to wherever you light switch is. Take a second wire,
hook it on to the second screw on the light switch (oh, by the way some
light switches may have 3 screws, one of the is for a ground, but you don't
need one. If you have a light switch with 3 screws, use the 2 screws that are
on the same side) and run it back into the computer and attach it to the
other side of the cut wire. Use electrical tape to secure the places where
the wires join. You may want to use some duct tape and secure the wires
inside the computer to the side of the case, so they don't hang down.
Actually, you better do this if you are thinking of making other "changes"
to your computer. I didn't, and when I tried to wire in music, it was
impossible to get at anything because of this web of wires.
ADD A VOLUME CONTROL
This is another bigger help. You have you install this instead of
an On/Off switch, but if you turn down the volume, you don't need an
On/Off switch. Just go to a hardware store and buy a dimmer switch. It is a
little knob thing that turns. Attach it to wires in the same way you attached
the light switch. There you go, no more blown out ears!
ADD A HEADPHONE JACK
Proceed the same way you did with the on/off switch. However, use 2
wires to branch off from the screws on the light switch/ dimmer switch. Go
buy a head phone 1/8 plug headphone extension cord. It should have a 1/8 plug
on each end. Also by an 1/8 male to 1/8 male converter. This is a little
thing about an inch long that has a hole in each end for a 1/8 plug. Cut off
one end of the extension cord. Cut the cord and attach the 2 wires inside to
the 2 wires you attached to the switch. Run the extension cord out the back
of your computer through an expansion slot, and shove the male to male
converter on the end. There, now you have a headphone jack
PIPE SOUND THROW YOUR STEREO
This is kind of cool, but is a lot of work. Before you do it,
consider if you want it. If you don't have a sound blaster, I would do it.
The only thing is hearing a simple system beep over full surround sound is
damn annoying. Also, if you see the note at the end, you can channel the
sound into your Sound Blaster Speakers, so you don't need the Stereo.
GET:
-a stereo with an AUX settings, that lets you hear music from an outside
source
-2 phono plugs
-Copper wire
-1 "Y" 1/8 headphone connectors
-2 1/8 Headphones extension cord (it should have 2 1/8 male plugs, 1 at each
end)
-1, 1/8 female to female gender changer. This will be about an inch long,
and have a 1/8 hole at each end
Ok, if you have an On/off switch/ Volume control already attached to
your speaker, then you will have to remove it. On your motherboard, there
should be a set of 4 pins (I've seen 2 pins, but this is rare) that will
have something like "SPKR" printed on the board under them. There will be a
little black thing about 1/2 inch by 1./2 inch covering these 4(or 2) pins.
There will be 2 wires coming out of this. These 2 wires connect to your
speaker. Unplug the Black thingy and cut both wires about 2 inches away from
the black thingy.
Next, take your 1/8 plug extension cord, and the plug at one end off
about 10 inches in from the end. There should be 2 wires inside of it. Strip
away the rubber casing around both wires, and cut it, so you have the 2
wires inside of the rubber exposed about 3 inches each. This is tricky,
because you might cut the wires inside when trying to remove the rubber.
Now ,take the 2 wires that were inside the rubber extension cord,
and attach each one to one of the wires on the black thingy that was on the
mother board. You should end up with this black thingy with 2 wires attaches
to an extension cord at one end. The cord will run about 6-8 feet and end in
a 1/8 male plug. From this step, you can pipe in the music through your
stereo, or your Sound Blaster speakers. To attack to a sound card. Plug it
into the Music IN hole.
THE FOLLOWING IS HOW TO ATTACH TO A STEREO:
Take the other extension cord. Cut off 1 end. Attach the phono plugs to the
wires. YOU NEED TO TAKE EACH WIRE COMING OUT OF THE CORD ADN ATTACH 2 WIRES
TO IT. This way you have 4 wires, 2 wires coming from each of the wires in
the cord. Pick 2 of the wires attach to 1 of the original wires to be
negative, and the other2 as positive. No attach 1 positive and one negative
to each plug. This will give you stereo sound instead of mono. Plug them
into the AUX IN phono plugs on the back of your stereo. use a male to male
converter to attach the 2 extension cords.
PIPE IN MUSIC TO PLAY
Use the exact same setup as above, but attach a Y-adapter to the end of the
male to male converter on the end that you plugged in the extension cord that
is attached to the motherboard. Use another extension cord that is male/male
and plug one end into a Walkman, CD player, etc and then the other into the
open hole in the Y-adapter
---------------
School Time fun
---------------
I took AP Computer Science last year at my high school, and my teacher was
the freshman football coach who had taken some C classes back in college and was
"teaching" us straight from the book. He really wasn't teaching, every day he
took us to the computer lab and told us to do the exercises. Anyway, the
exercises were boring. So the mischief began.
So, my school ran on Novell NetWare VER something or other, but it was
very new for a school. (copyright 97 or something). Novell is a VERY easy
network to break. When the log in screen comes up, simply push the little
"windows" key on a win95/98 keyboard. A little box comes up that says "tasks"
Use "File" and go to shutdown. Then select "log off and sign on as new user" or
something like that, it is the last option on the windows shutdown menu.
Novell then says, "oh shit, they aren't logged on, so how do I log them
off!" It then wets itself, and then gives you full access to the computer.
Ok, lets say you are logged on to whatever network they have. Try using
the [windows key] + [F]. This should pop up a FIND window. Search for explorer
and then run any program on the computer.
If you are on the network, but those things don't work. If you can run
Word 97, simple go to "view" and toolbar and web. Type in the address of were
you what to go and Windows open your internet browser.(probably IE or Netscape)
Also you can type in just plain old "C:\" in the address box and Windows opens
Explorer for you.
Now this AP comp SCI class was all in C++, and I was just learning all the
sound stuff. Anyway, C++ has a command that is exactly like the SOUND command.
There is just one problem, the speaker keeps emitting sound constantly until you
run the nosound() command. Well shit, I hadn't learned the nosound() command
yet, so for 4 minutes my computer gave off a very high pitched tone, until I
figured out what to do. I promptly complied the program and put it in the
startup folder of every computer in school, signing it as another students name.
Information should be free. Hack your school.
---------
Face Lift
---------
Don't you hate the way that Qbasic does everything in Military Time?
Well, in this issues Face Lift, I have a alarm program that not only
converts from military time to regular time, but also allows you to type in
a time in almost ANY format, and it will convert it to military time!
DECLARE FUNCTION FullTime$ ()
DECLARE FUNCTION FullToMil$ ()
PRINT
PRINT "Acidus Sleeper VER 1.0"
PRINT "Current Time is: "; FullTime$
wake$ = FullToMil$
PRINT
PRINT "Sleep Mode Active..."
SLEEP 3
CLS
DO
LOOP UNTIL wake$ = TIME$
DO
SOUND (1000), .1
LOOP UNTIL LEN(INKEY$)
PRINT "Good morning"
SYSTEM
FUNCTION FullTime$
t$ = TIME$
hour% = VAL(LEFT$(t$, 2))
tt$ = "am"
IF hour% = 0 THEN hour% = 12
IF hour% > 12 THEN hour% = hour% - 12: tt$ = "pm"
FullTime$ = LTRIM$(STR$(hour%)) + MID$(t$, 3, 3) + tt$
END FUNCTION
FUNCTION FullToMil$
1
PRINT
PRINT "Please type in when you want to wake up (hh:mm)"
LINE INPUT in$
half$ = UCASE$(RIGHT$(in$, 2))
IF LEN(in$) < 4 OR LEN(in$) > 5 THEN
BEEP
PRINT "Invalid time must be (hh:mm)"
GOTO 1
END IF
OneToNine% = 0
hour$ = LEFT$(in$, 2)
IF RIGHT$(hour$, 1) = ":" THEN hour$ = LEFT$(hour$, 1)
hours% = VAL(hour$)
IF hours% < 1 OR hours% > 12 THEN
BEEP
PRINT
PRINT "Invalid Time: Must be in 12 o'clock format (hh:mm)"
GOTO 1
END IF
half% = 0
2
PRINT
PRINT "AM or PM"
LINE INPUT half$
3
test1% = LEN(half$)
IF test1% <> 2 THEN GOTO 2
half$ = UCASE$(half$)
IF half$ <> "AM" THEN
IF half$ <> "PM" THEN
GOTO 2
END IF
END IF
MilHour$ = ""
IF half$ = "PM" THEN
MilHours$ = STR$(hours% + 12)
ELSE
MilHours$ = STR$(hours%)
END IF
'trim off spaces
MilHours$ = RTRIM$(LTRIM$(MilHours$))
IF MilHours$ = "12" AND half$ = "AM" THEN MilHours$ = "00"
min$ = (RIGHT$(in$, 2))
FullToMil$ = MilHours$ + ":" + min$ + ":00"
END FUNCTION
----------
Quick tips
----------
Your awesome graphics screen is Shattered by "REDO FROM START"
because some moron tried to enter in a letter in the place of a number. The
following FUNCTION loops until they enter a number value.
FUNCTION InputNum ()
`get the current line and row
Y%=csrlin
X%=pos(0)
DO
Locate Y%,x%
LINE INPUT a$
If instr(A$,"0") then `check if they entered zero
InputNum=0
Exit function
End if
Z=val(a$)
If Z then
Inputnum=Z
Exit Function
End if
Beep
loop
-----
Abort
-----
This has been a great issue. I hope you enjoyed it. Damn, I have tons more
to write out for Issue V. I have one message to you. Explore. I know jack crap
about Novell, and how to break security. All that stuff with Word 97, I stumbled
onto while proofreading this issue. If you don't understand something, just
think about what would be the simplest way to do something, and that's how it
more likely than not works. I figure out encryption, networks, multi-tasking,
task swapping, without ever picking up a book. I later asked people about it,
and the basic idea that I came up with was right. NEVER LIMIT YOUR MIND
Hack the Planet,
Acidus