(Untitled)

Apr 10, 2009 01:54

So I woke up today in the mood to get a little C# programming done. Today has been highly educational in that I learned exactly what I have been doing wrong with object oriented programming. Well, actually, I'm pretty sure I'm still doing a lot of stuff wrong. Luckily, this is just a hobby. What lies behind the cut is the progress I made.

Himitsu Warning )

Leave a comment

Comments 6

angeling April 10 2009, 12:48:38 UTC
The first things we worked on at CS were sorting algorithms. For the last program for the class, we had to code a little game in which you had to take a "boat" to the other end of the "sea" while there was a battle going on (there'd be some other ships and such in the "sea", all represented by ASCII, and you could move one line per "turn"; each turn two "cannon balls" would hit specific coordinates - if you were hit it was game over, if it hit any of the other vessels they'd "sink").

Those things were surprisingly helpful to learn programming logic. Part of me almost wishes I'd finished CS...

Reply

willfor_iv April 10 2009, 17:50:05 UTC
Yeah, these basic programs do a lot to help my understanding of programming. I think after doing what I already have done, I could take on something a little more ambitious, but I think I will stick to this until I have something at least half-way presentable. I hear one of the worst habits to get into is not finishing what you start.

Reply

angeling April 10 2009, 18:25:47 UTC
That's probably why they had us stick to simple functions first, then move on to a "full" program. My teachers were very strict though - i.e. bad formatting would make you lose marks. Though in hindsight I now thank them for it, since readable code = awesome.

What are you using for randomizations, the one function that uses the computer clock?

Reply

willfor_iv April 10 2009, 18:31:52 UTC
That's actually C#'s default. Unfortunately, my program runs too fast to have it initialise itself every time it goes into a function, so I have to pass a new seed along to every function that uses randomisation. (which isn't that many to be honest)

Reply


Leave a comment

Up