Ryan Bowen 2011. Powered by Blogger.
RSS

I Make A Foolish Mistake, As Usual

For those of you who understand programming, take a look at this code and have a good laugh at me:



For those who don't understand where I went wrong, here's what I stupidly did:

I set it so that if the user entered something that wasn't a digit, it would ask them to type a new value.

Alas I thought I was being clever by using "confirmed--" which tells the code to reduce the value of confirmed by one. What I didn't consider what that, if the user did it wrong more than once, the value of confirmed would plummet into negative numbers and the loop would last forever. Even if the user did enter a correct digit!

I'm working on fixing it now, I haven't had much time to work this week but I intend on catching up!

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

A Retry

I'm currently working on doing my first assignment for my programming class; it was due about four months ago.

No, I'm not late, I'm actually doing it again with my newer superior knowledge than what I had then. I didn't receive a great mark, at the time I was really struggling with C mainly because I didn't have Engineering Problem Solving with C (3rd Edition) which was necessary to the course.

I don't know if I can post the code, in case it's a breach of university rules of something so I won't. But I'll let you know of my progress.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

New Look!

Well the blog is no longer a barren, simple blog. It's now a sexy, suave new piece of online brilliance!

Let me know in the comments what you think.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Terrain Navigator: Complete!

Well that was very easy I'm glad to say, it's restored faith in my abilities as a programmer!

Here's the final code, usually I would separate this into separate functions but since it's only a small exercise I just left it all in main.


  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Terrain Navigator Update

Well here it is so far:




  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

The Slaying of The Turtle

Okay so my recent attempts to create this "turtle graphics" program hasn't gone too well. So I given up.

Okay so I haven't given up but I chose to postpone it until I know more about arrays, especially 2D ones. Thus I  have turned to Engineering Problem Solving with C (3rd Edition) and it's chapters on arrays.

I am about to begin work on a fun sounding "Terrain Navigation" exercise, simulating a robot navigating hills: the program will look at a 2D array and evaluate based on height information where peaks and valleys occur.

I'll post my progress later this evening if I do well!

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Total Pageviews