modular

365 Programming is Simple?

The following is an example of a simple programming "challenge":

Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

Below I've thrown together a solution in less than 5 minutes, BUT, I thought to myself, experimentally, what would the code look like if I needed something more "Best Practice"...

365-31 Command Line Clock continued (winclockv2)

Slowly working towards the final product, indeed I do see that I have a working executable at every stage (even if the steps are small and the tests are numerous)...

(The looping part does not quite work yet...)

/* 
2010-01-31 john pfeiffer, MS windows clock

PROGRAM DESIGN
	MS window with X, quit button, and current system time displayed
	Hour:minute:second  (hh:mm:ss)

HIGH LEVEL FUNCTIONS	
	
	update current time
	see if user clicked button
		quit if button clicked

	display current time on window


ORGANIC ITERATIVE BUILDS
Syndicate content