📅June 9th, 2004
This is a school project. Used Visual C++ 6.0 with MFC. At the time I was trying to do two things: learn C++ language, and Windows programming. I ended up getting a good mark on the project. It was scoped to something I can do in the time constraints.
The program was made to look like SimCity for the SNES which is a game I liked playing at the time.
Find it posted here: https://github.com/clandrew/SimCityMfc
📅November 8th, 2003
An old contest question.
Taken from this forum post--
http://compsci.ca/v3/viewtopic.php?t=2192
The question
A spiral of numbers can start and end with any positive integers less than 100. Write a program which will accept two positive integers x and y as input, and output a list of numbers from x to y inclusive, shown in a spiral. You may assume that the end value is greater than or equal to the start value.
A spiral starts with the first number in the centre. The next number appears immediately below the first number. The spiral continues with the numbers increasing in a counter-clockwise direction until the last number is printed. Read the input from the keyboard and display the output on the screen.
Sample session:
Start value:
10
End value:
27
27 26
16 15 14 25
17 10 13 24
18 11 12 23
19 20 21 22
Start value:
10
End value:
12
12 11
7 10
8 9
In Object-Oriented Turing, the solution:
var start, finish, r, c, counter, i, rchange, cchange : int
get start, finish
r := 13
c := 40
counter := 1
i := start
rchange := 1
cchange := 4
loop
exit when i >= finish
for j : 1 .. counter
locate (r, c)
if i < 10 then put " ", i .. else put i .. end if exit when i >= finish
i += 1
r += rchange
end for
for j : 1 .. counter
locate (r, c)
if i < 10 then put " ", i .. else put i .. end if exit when i >= finish
i += 1
c += cchange
end for
rchange *= -1
cchange *= -1
counter += 1
end loop
📅November 10th, 1999
A logic puzzle.
The Pillon Robbery
It was pouring with rain that Saturday when Glen Roberts searched his garage for the tool he needed to fix his convertible roof. It wasn’t there, so he decided to look for it later and went back into the house.
The phone rang. He picked it up and it was his friend, Paul.
“Did you hear about the robbery?”
“…..No.”
“The Pillon family across the street was robbed.”
“Really? Who did it?”
“The police don’t know yet. I bet the thief is rejoicing right now, though, getting away with something like that. That family has always been rich. I guess unless they find the criminal, the Pillons will turn out like my family, in financial trouble, I mean. We’ve never been too well off.”
“Well I know, but I can’t relate. Anyway I need to go, maybe I’ll see you later.”
He then heard the doorbell ring and went to answer it. It was the police.
“I’m officer Miller. I’m going to ask you a few questions having to do with the robbery at your neighbor’s house. First of all, do you know about it?”
“Yes. My friend told me.”
“Have you seen anyone suspicious around lately?”
“No, I haven’t seen anyone like that.”
“Where were you today?”
“ I was just driving around, shopping and running errands.”
The police officer paused and looked like he was thinking. He then went to his car and got another police officer and they arrested him.
Why did they arrest him?
