Search found 16 matches

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

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?
by Quibbler
Tue Jan 30, 2007 1:52 pm
Forum: QBASIC and QB64 Questions & Answers
Topic: Need some TIMER help
Replies: 5
Views: 11920

tt=timer
for t=1 to 10
while timer-tt<t:wend
print t
next t
by Quibbler
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: 12291

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 ...
by Quibbler
Fri Oct 13, 2006 6:37 am
Forum: QBASIC and QB64 Questions & Answers
Topic: 2d arrays
Replies: 6
Views: 10639

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...
by Quibbler
Thu Oct 12, 2006 7:50 am
Forum: QBASIC and QB64 Questions & Answers
Topic: 2d arrays
Replies: 6
Views: 10639

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
by Quibbler
Wed Oct 11, 2006 6:41 am
Forum: QBASIC and QB64 Questions & Answers
Topic: ARRAYS
Replies: 3
Views: 8021

You can't use T twice (you have FOR T=... and INPUT T...)
for your other problem arrays are the answer

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.
by Quibbler
Wed Aug 30, 2006 8:35 am
Forum: QBASIC and QB64 Questions & Answers
Topic: How to slow this down?
Replies: 20
Views: 34223

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 ...
by Quibbler
Wed Aug 30, 2006 7:25 am
Forum: QBASIC and QB64 Questions & Answers
Topic: How to slow this down?
Replies: 20
Views: 34223

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.
by Quibbler
Thu Aug 17, 2006 9:45 am
Forum: QBASIC and QB64 Questions & Answers
Topic: anagram solver
Replies: 9
Views: 34027

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...
by Quibbler
Wed Aug 16, 2006 9:05 am
Forum: QBASIC and QB64 Questions & Answers
Topic: anagram solver
Replies: 9
Views: 34027

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...
by Quibbler
Mon Aug 07, 2006 11:20 am
Forum: QBASIC and QB64 Questions & Answers
Topic: a rather simple calculation problem
Replies: 4
Views: 8410

You are assigning a value to c so the c comes first

c=....
by Quibbler
Mon Jun 12, 2006 7:00 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Scientific Notation / Decimals Question
Replies: 5
Views: 8197

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.
by Quibbler
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: 14121

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.
by Quibbler
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: 14121

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...
by Quibbler
Tue Feb 28, 2006 11:08 am
Forum: QBASIC and QB64 Questions & Answers
Topic: Point of Intersection
Replies: 8
Views: 13414

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 *...
by Quibbler
Tue Jan 24, 2006 7:50 am
Forum: QBASIC and QB64 Questions & Answers
Topic: loading excel files
Replies: 14
Views: 20676

It's easier to read in the excel file as is particularly if you have a lot of them to deal with. I just used a HEX viewer to find the delimiters and the field length. Oh also I would never use excel it horrible to use and it discourages people from learning how to program - always write your own dat...