newb... I guess.

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
villeballa89
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 34
Joined: Sun Aug 31, 2008 8:44 pm

newb... I guess.

Post by villeballa89 »

Okay, like I said in the other thread... I'm new to C ( as in about a week or two new) and was wondering what would be a couple of good practice projects to work one.... anyone?
User avatar
cypher1554R
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1124
Joined: Sun Jun 22, 2008 5:06 pm

Post by cypher1554R »

Get a book, and go by it.. You can't miss..
villeballa89
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 34
Joined: Sun Aug 31, 2008 8:44 pm

Post by villeballa89 »

I think that'd works if I wasn't such a cheap SOB. but..... anyone got a couple ideas that would be challenging but not impossible? something that's get me to learn the C libraries..... anything?
User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Post by JS Lemming »

Make hangman. You'll learn all sorts of stuff.
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
User avatar
Arce
Jealous Self-Righteous Prick
Jealous Self-Righteous Prick
Posts: 2153
Joined: Mon Jul 10, 2006 9:29 pm

Post by Arce »

Here's some my teacher assigns the class:

* Fibonacci sequence using recursion
* Factorial using recursion
* base 10 to binary converter
* base 10 to hexadecimal converter
* Fibonacci sequence using loops
* Tic-tac-toe
* Hangman
* Fish simulator.
Click here to see the hidden message (It might contain spoilers)
Make a 9x9 array to represent open water. Making an object oriented app, create fish with random locations within the array, and a random direction (left or right). Also give them a random lifespan between 1&20. Each 'turn' have it move all fish one space in their facing direction and add one to their age (when age >= lifespan, kill the fish). If it reaches side of array, make it take a turn to turn around. Make it robust--no fish on same square, if fish collide make them turn in opposite directions, etc.
---More advanced: Using inheritance, derive new classes from the base fish class. Override previous movement functions (or make them virtual) to allow new fish to have different movements, such as one that can go diagonal, one that is 'fast' and jumps 2 squares.

* English->piglatin converter.

If you give me a certain field you're trying to hit, i could make up and 'assign' ya an application using said field.

Example, ask me for an app requiring inheritance, I'd tell ya the fish one. Too lazy to type more atm, will upon request. Also, look online, shitloads. Are you more into games, or computer science type applications?
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
User avatar
Arce
Jealous Self-Righteous Prick
Jealous Self-Righteous Prick
Posts: 2153
Joined: Mon Jul 10, 2006 9:29 pm

Post by Arce »

Woop, just realize you said you're learning C rather than C++. Disregard the apps requiring inheritance and other non-C things.
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
villeballa89
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 34
Joined: Sun Aug 31, 2008 8:44 pm

Post by villeballa89 »

well I'm more of a game oriented person but anything that requires math (up to precal) seems like it'd work for me...... though it might be hard for me to figure out howto do some of the stuff... ( like in class I just recently confuse scanf and gets)
User avatar
Arce
Jealous Self-Righteous Prick
Jealous Self-Righteous Prick
Posts: 2153
Joined: Mon Jul 10, 2006 9:29 pm

Post by Arce »

Aight, try this:

Make me a number guessing game. Have the computer generate a random number between 1 and 100. Then have it ask you for your guess. If you guess too high, make it tell you "guessed too high." If you guessed too low, make it tell you "guessed too low." If you guess the number correctly, make it say "YOU WIN!". Make it count the number of times you guess. If you do it incorrectly more than 5 times, make it say "YOU LOSE!!!"
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
villeballa89
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 34
Joined: Sun Aug 31, 2008 8:44 pm

Post by villeballa89 »

Okay sounds easy enough. Only difficulty I think I may have is the limit on the guesses. Want me to post the final code here when I get it working or what? also...... could use a bit other help in the other thread I started...... wanted to try to keep that as a seperate topic since it's...... its own subject.
User avatar
Arce
Jealous Self-Righteous Prick
Jealous Self-Righteous Prick
Posts: 2153
Joined: Mon Jul 10, 2006 9:29 pm

Post by Arce »

Sure, post the code. Be sure to use the 'code' tag and the 'spoiler' tag (so that it doesn't take up space).

And yes, keeping track of the amount of guesses will likely be the biggest challenge.

Good luck.
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
Post Reply