Simple Confusion
Blitz3D Forums/Blitz3D Beginners Area/Simple Confusion
| ||
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 |
| ||
Make sure not to use integers when multiplying small numbers: plot ((640.0/804.0)*count#) ... I'm not sure right now, but intvar * 0.123 or 0.123 * intvar will return a integer result (in this case zero) There is no Fill command in Blitzbasic, but there are several Fill Functions in the code archives (flood fill). Welcome! I used GFA on the ST too, it was pretty good. It took many years until I found Blitz for the PC that I found as comfortable as GFA on the ST. Even GFA on the PC wasn't satisfying for me, at least not the earlier versions, and the later versions became pretty expensive. Now, with the wrapped Direct3D Engine Blitz3D is just a dream that came true to me. |
| ||
Many thanks jfk EO-11110 Stopped pulling the hair out now. I am quite sure it will take me a while to start working on 3D projects, but I am more than amazed at what can be achieved with such a simple to underatand basic. |