Qbasicnews.com

Full Version: FreeBasic forum and examples/previews quicklist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Or read my topic in the debate forum and stop arguing.


And:
Code:
Flag = 0
For a = 0 to 10000
If Array(a) = 0 Then Flag = 1: Exit For
Next
If Flag = 0 Then
Print "Aaaw, no free slot!"
End
End if
array(a) = 1

Code:
For a = 0 to 10000
If Array(a) = 0 Then Goto GotIndex
Next
Print "Aaaaw, no free slot!"
End
GotIndex:
array(a) = 1
USE WHAT YOU FUCKING WANT Big Grin

I'll keep using my GOTOs to exit nested loops and ifs at once Wink
Goto is almost as useful a tool in debugging as any debugger. Why remove it?
Lets write a game using only GOTOS to control program flow, just to piss Blitz off Big Grin

I honestly think GOTO is very useful, it's used in many languages, and it's so easy to implement. Like Rel said, it makes debugging a lot easier.

Anyway, there's no need to force anything on anyone.
I like goto, so what?! ;-)
Wow! now GOTO is become an issue. Whats about it that was so 'evil' for programmers? I used to see some matured/old-timer basic coders use them widely and normally I can't follow their coding style at first. But when I use them, I feel a bit fredom in coding it.
I'll agree goto was very harmful when it was used with line numbers, but I think it's fine and readable enough if you use it to do things that are simple and reasonable but impossible without goto (like exiting multiple DO/LOOPs at once without using an exit flag), or if you only goto informatively named labels... as long as you don't use goto too much and never use it in place of something like an IF block or a DO/LOOP - that's just wrong, use high level language constructs instead of goto whenever possible.
Goto is impossible to avoid. You GOTO, it gets turned into jmp. If you call a SUB, it uses jmp and a return register. Same for GOSUB. This entire argument is desultary. Use clean code if you're in a group, don't give a rat's petunia about clean code and use goto where it's convenient.
Here's a new 3D demo!!! Big Grin

It has a few bugs, but it's still pretty cool to me. Tongue

http://www.qbnz.com/dr_davenstein/glu_LookAt.zip
:o :o :o :o :o :o

That's awesome!!!!!

I can see you're using the camera ftansform used by Ben Humphrey and Alan Bayliss. :*)

I'm using them as well. :*)

For a 3rd person perspective ala metal gear solid, try to swap the Camera lookat and the camera itself.

That collision is what most 3d coders use(spherical) but you can optimize it a lil bit by not using SQR and testing it by 25 instead of 5.

Try to do a display list. It would make it real fast. :*)

Now that the GLu header is finished, try to add some quadrics for NPCS. Smile

Can the OBJ file have normals in them?
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16