Page 1 of 1

newb... I guess.

Posted: Mon Sep 01, 2008 4:20 pm
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?

Posted: Mon Sep 01, 2008 5:30 pm
by cypher1554R
Get a book, and go by it.. You can't miss..

Posted: Mon Sep 01, 2008 6:22 pm
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?

Posted: Mon Sep 01, 2008 9:35 pm
by JS Lemming
Make hangman. You'll learn all sorts of stuff.

Posted: Tue Sep 02, 2008 5:13 pm
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?

Posted: Tue Sep 02, 2008 5:18 pm
by Arce
Woop, just realize you said you're learning C rather than C++. Disregard the apps requiring inheritance and other non-C things.

Posted: Wed Sep 03, 2008 3:15 pm
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)

Posted: Wed Sep 03, 2008 11:00 pm
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!!!"

Posted: Wed Sep 03, 2008 11:15 pm
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.

Posted: Wed Sep 03, 2008 11:25 pm
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.