## Search found 16 matches

Tue Jan 30, 2007 2:25 pm
Forum: General Discussion
Topic: Code messed up during posting
Replies: 1
Views: 5315

### Code messed up during posting

Every time I try to post code bits of the code are fcuked up. usually its parts that contain <or> I even had a subroutine giong missing. Am I doing somthing wrong or is it a forum problem?
Tue Jan 30, 2007 1:52 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Need some TIMER help
Replies: 5
Views: 7723
tt=timer
for t=1 to 10
while timer-tt<t:wend
print t
next t
Mon Jan 22, 2007 7:39 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Formula to Calculate the Cube Root of a Number
Replies: 3
Views: 8322
Ok so maybe you only need the real root for your calcs. Here's something for your amusement it calculates all the roots - so just like a square root has 2 solutions a cube root has 3 solutions. I have set it to do the cube root of 8. So the answers are 2 and -1?sqr(3)i. I have edited this as line 8 ...
Fri Oct 13, 2006 6:37 am
Forum: QBASIC and QB64 Questions & Answers
Topic: 2d arrays
Replies: 6
Views: 7374
Yes you could use a binary/random access file, but this is much more tricky, and you seem to be having trouble with the sequential files. 1600 numbers are nothing to a computer and your numbers are short integers as well. Short answer is don't be afraid of over-taxing your computer. You are, I presu...
Thu Oct 12, 2006 7:50 am
Forum: QBASIC and QB64 Questions & Answers
Topic: 2d arrays
Replies: 6
Views: 7374
1. Read the numbers into a matrix "2D array".
2. Change the number that is wrong
3. Write the numbers back into the same file.

open.....for input
for i=1 to 3
input#1, M(i,1),M(i,2),M(i,3)
next i
close #1
M(2,2)=3
open...for output
for i=...
write ....
etc...etc
Wed Oct 11, 2006 6:41 am
Forum: QBASIC and QB64 Questions & Answers
Topic: ARRAYS
Replies: 3
Views: 5364
You can't use T twice (you have FOR T=... and INPUT T...)

FOR I=1 to N
input "name";name\$(i)
input "tickets";t(i)
next i

Don't forget is you're going over 10 you will need to dimension these arrays.
Wed Aug 30, 2006 8:35 am
Forum: QBASIC and QB64 Questions & Answers
Topic: How to slow this down?
Replies: 20
Views: 20899
What!! anybody would think that this was a C++ forum get real this is qbasic. If you're soooo fussy you could calibrate the delay loop against TIMER first. There are other ways of getting short delays but they are much more involved like reading the screen refresh or you could even change the clock ...
Wed Aug 30, 2006 7:25 am
Forum: QBASIC and QB64 Questions & Answers
Topic: How to slow this down?
Replies: 20
Views: 20899
The easiest way is to use a delay loop

For i=1 to 10000:next i

but obviously the time delay will depend on the speed of the computer. Timer increments are about 50 ms so are often too long for many applications.
Thu Aug 17, 2006 9:45 am
Forum: QBASIC and QB64 Questions & Answers
Topic: anagram solver
Replies: 9
Views: 20867
I downloaded a word list about 12 years ago and amazingly the link is still there (with a 100 thousand extra words added) http://www.dcs.shef.ac.uk/research/ilash/Moby/mwords.html I may even be able to find my Qbasic program that reads it. The program was actually to do those competitions of the typ...
Wed Aug 16, 2006 9:05 am
Forum: QBASIC and QB64 Questions & Answers
Topic: anagram solver
Replies: 9
Views: 20867
Anagram solver? Well for a N letter word there are N! permutations - far too many. I have written a similar program and the best approach is to search a dictionary file. First check is the length, then if the anagram and a dictionary word have the same length use INSTR to check the letters are all t...
Mon Aug 07, 2006 11:20 am
Forum: QBASIC and QB64 Questions & Answers
Topic: a rather simple calculation problem
Replies: 4
Views: 5464
You are assigning a value to c so the c comes first

c=....
Mon Jun 12, 2006 7:00 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Scientific Notation / Decimals Question
Replies: 5
Views: 5659
You would be better opening your file for input that is as a sequential file. As it is you are doing almost everything wrong in your attempt to read the file as random. Which is why you are getting nonsense answers - nothing to do with scientific notation.
Tue May 30, 2006 1:31 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: How to make a ball bounce in a parabola?
Replies: 6
Views: 9575
Don't you think you're over-complicating this.
To get a reasonable bouncing ball just keep x-velocity constant and cause the y-velocity to decrease to zero going up and increase going down.
Tue May 30, 2006 12:51 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: How to make a ball bounce in a parabola?
Replies: 6
Views: 9575
Maybe this will give you some ideas SCREEN 12 WHILE bounce < 1000 IF x >= 620 THEN ix = -.1: ic = 0: ib = 1 IF x <= 0 THEN ix = .1: ic = 0: ib = 1 x = x + ix IF y >= 480 THEN iy = -1: ic = ib IF y <= ic THEN iy = 1 ib = ib + 40 bounce = bounce + 1 END IF y = y + iy * (y - ic + 5) * .01 CIRCLE (xo, y...
Tue Feb 28, 2006 11:08 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Point of Intersection
Replies: 8
Views: 8508
Ok so this will find the intersection of two lines. If the Y,X answer is outside the range of either of the two line segments (as it is in my example) then they do not inersect. y1a = 10: x1a = 20: y2a = 20: x2a = 30 y1b = 5: x1b = 7: y2b = 15: x2b = 22 ma = (y1a - y2a) / (x1a - x2a) ca = y2a - ma *...
Tue Jan 24, 2006 7:50 am
Forum: QBASIC and QB64 Questions & Answers