Hi All,
I used to write a lot of programs when I was younger, using GFA Basic for the Atari ST. I have tried a few basics for the PC, including writing quite a few things with DarkBasic, but until now have not found a basic I am happy with. I downloaded Blitz Basic and found myself very comfortable with the editor side of things, also the examples really impressed me, so I purchased the software.
Ok, I am way out of practise and I realise I may be missing the most basic (excuse the pun) and obvios error, but I quickly typed in the first ever program I ever copied out of a book way back in 1982 into a BBC micro. It was a program that worked out how long it would take all the fish to die in a fish tank, if the tank was leaking at the rate of 1/500 per hour. It also did a little running graph. Well as far as I can remember, the following program should work, but for some reason the plot coordinates always remain at zero, I am sure the same code would work in every other version of basic I have used.
The code is as follows:
Graphics 640,480,16,2:Color 0,255,0
water#=500:count=0
Repeat
leak#=water#/500
water#=water#-leak#
count=count+1
Plot ((640/804)*count),((480/500)*water#)
Until water#<=100
Text 50,50,"All the fish are dead in "+count+" hours"
Also, I don't see a graphics 'Fill' command?
Sorry if this is long winded, sorry also if I am overlooking something really stupid :)
Thanks
I used to write a lot of programs when I was younger, using GFA Basic for the Atari ST. I have tried a few basics for the PC, including writing quite a few things with DarkBasic, but until now have not found a basic I am happy with. I downloaded Blitz Basic and found myself very comfortable with the editor side of things, also the examples really impressed me, so I purchased the software.
Ok, I am way out of practise and I realise I may be missing the most basic (excuse the pun) and obvios error, but I quickly typed in the first ever program I ever copied out of a book way back in 1982 into a BBC micro. It was a program that worked out how long it would take all the fish to die in a fish tank, if the tank was leaking at the rate of 1/500 per hour. It also did a little running graph. Well as far as I can remember, the following program should work, but for some reason the plot coordinates always remain at zero, I am sure the same code would work in every other version of basic I have used.
The code is as follows:
Graphics 640,480,16,2:Color 0,255,0
water#=500:count=0
Repeat
leak#=water#/500
water#=water#-leak#
count=count+1
Plot ((640/804)*count),((480/500)*water#)
Until water#<=100
Text 50,50,"All the fish are dead in "+count+" hours"
Also, I don't see a graphics 'Fill' command?
Sorry if this is long winded, sorry also if I am overlooking something really stupid :)
Thanks