O'Reilly logo

DarkBASIC Pro Game Programming, Second Edition by Joshua R. Smith, Jonathan S. Harbour

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introduction to Program Logic

First I would like to talk about program logic, because you should understand this before you get into subroutines. DarkBASIC calls all subroutines functions, but I’ll get to that in the second half of the chapter.

What is logic and how does it relate to programming? When I hear the word logic, I think of several descriptions—analysis, deductive reasoning, processing, the rival of intuition. Computers are great at performing logical commands, but how does logic work in DarkBASIC? Most programming languages have a standard set of branching statements that you can use to create the logic in a program. The two branching statements in DarkBASIC are IFTHEN and IFELSEENDIF. These statements can be more formally ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required