One of the most common questions I get from my For Dummies programming titles is regarding the lotto programs. That code demonstrates how you can randomly draw lotto balls without drawing the same ball twice.
Continue reading
Author Archives: dgookin
The Caesarian Cipher
A Caesarian Cipher is one of the simplest, weakest forms of encryption. Supposedly developed by Julius Caesar, it’s a letter substitution cipher: A becomes C, B becomes D, C becomes E, and so on.
Continue reading
The Difference Between NULL and Zero
University professors will try to drive the point into your head all semester: NULL and zero are not the same thing! But yet, you’ve looked into memory, you’ve examined the code. That thing they call NULL sure does look like a zero! What’s the big difference?
Continue reading
What is True?
True is a logical condition. It’s often written TRUE just to confuse it with “true” which is a word that has other implications. But for programming, TRUE generally means success. It’s the opposite of FALSE, which generally means failure.
Continue reading
For Ever
The most basic and perhaps ancient of programming techniques is the loop. And the most basic loop is the for loop. It’s also pretty flexible.
Continue reading
Multiplying Without Multiplication
Long, long ago, I was an ardent assembly language programmer. I admired coding in assembly because the programs were small and fast. On the early microcomputers, that was a plus.
Continue reading
We Have a Winnah!
The game of Tic-Tac-Toe is played on a simple 3-by-3 grid, what C programmers would call a matrix. It’s not The Matrix, of course, but it’s a simple array in which players can battle.
Continue reading
Text to Value Conversion
Sure, your programs can accept values from the input stream, but most of the time numeric input comes in the form of text. The issue then becomes how to transform the string “1234” into the value 1234.
Continue reading
Hi-Low
Here’s a brain puzzle for you: Write a function that accepts a numeric array and returns the high and low values from that array. Can it be done?
Continue reading
Say It in Binary
01010011011000010111100100100000010010010111010000100000
01101001011011100010000001000010011010010110111001100001
011100100111100100001010
Continue reading