Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > The Academy > Tilted Knowledge and How-To


 
 
LinkBack Thread Tools
Old 07-22-2003, 03:48 PM   #1 (permalink)
Poo-tee-weet?
 
JStrider's Avatar
 
Location: The Woodlands, TX
keeping my C++ skills brushed up over the summer

well i took the first programing principles class in the spring and am taking the second this fall and i was wanting to keep my skills from degrading too far... and was wanting some ideas for some fun projects to do....

im learning C++ and know functions and multiple dimension arrays... all that kind of stuff... but it hasnt been any object oriented stuff... thats the next class...
__________________
-=JStrider=-

~Clatto Verata Nicto
JStrider is offline  
Old 07-22-2003, 04:46 PM   #2 (permalink)
Banned
 
Location: 'bout 2 feet from my iMac
depends, what kind of stuff do you want to to? make a textbased minesweeper? I was impressed by that when i saw it, at one point...
cheerios is offline  
Old 07-22-2003, 07:27 PM   #3 (permalink)
Crazy
 
Location: Springfield, VA
If you are interested in gaming...
Teach Yourself Game Programming in 24 Hours

This book should really get you familiar with C++.
The first few chapters are a bitch, but once you get past them, its really good.
glophead is offline  
Old 07-22-2003, 10:43 PM   #4 (permalink)
Upright
 
Location: Denver
Hehe....I've got an evil one for you....

Write a text based Hangman game

What it should do:

1) Take a text file as a command line argument
2) Parse the text file to change all letters to the same case, remove punctuation and remove duplicate words
3) Put words into some data structure
4) Pick a length at random (remove all others from the data structure)

Now for the fun stuff....
5) Prompt user for a letter (Note: that you have not picked a word yet, remove all words from the data structure that contain picked letter)

You will notice that this is a devious program, in that it does whatever it can to tell the user that they entered an incorrect letter, only when the letter chosen results in one word does the program actually 'pick' the word itself.


Challenges:
-Make your own data structure (no STL)
-Play with GUI libraries to make a pretty user interface
__________________
Do be do be do
Edvard_Grieg is offline  
Old 07-22-2003, 10:47 PM   #5 (permalink)
Tilted
 
C++ is a good language, but beware of some books. They teach some very bad methods for programming (and I can't tell you which are good and which are bad, really). If you want to keep your skills sharp, just pick a small project and work on it. Experiment with new things. At least, that's been my method. I never could stay in step with those "Teach Yourself (C++, Game Programming, World Domination) in (24 hours, 7 days, a millenia)" books.

Also, if you were a Linux user, I'd suggest grabbing some code from a project and just hacking on it a bit. Especially applications like gkrellm, Gaim, etc. that you could write plugins for.
ChipX86 is offline  
Old 07-23-2003, 12:11 PM   #6 (permalink)
Upright
 
Location: Orlando, FL
Probably the best way

Is to join your schools programming team.

I participated in the programming team for years and am a much better programmer for it.

You will learn a lot of stuff that isn't convered in class and you will become very good at implementing the theories that you are learning.

Just my .02

Peter
pdoege is offline  
Old 07-23-2003, 12:58 PM   #7 (permalink)
Too hot in the hot tub!
 
pixelbend's Avatar
 
I can relate to this. I took a VB class last semester and it has all but leaked out.

I'm sure if I got into again it would all come back though.
__________________
But I don't want ANY Spam!
pixelbend is offline  
Old 07-23-2003, 06:53 PM   #8 (permalink)
Upright
 
Quote:
Originally posted by ChipX86
Also, if you were a Linux user, I'd suggest grabbing some code from a project and just hacking on it a bit. Especially applications like gkrellm, Gaim, etc. that you could write plugins for.
Even if you don't have Linux, many of the opensource applications are available for Windows. Many of the most well known and respected programmers say that the best way to learn to code is by looking at other's source code. I know that when I get free time, I tend to browse through projects like Mozilla, OpenOffice and the like. Sure, they are rather advanced for someone that is still learning C++. You can atleast look at the code structure, doc, and technique.

If your summer is long, make a project for yourself. Even if it has little to know use. It will atleast keep you fresh.
XXXs is offline  
Old 07-24-2003, 07:16 PM   #9 (permalink)
Upright
 
Fake robot colony. Make a simulation where ants would go and find food and then return it to a base, when-ever the base has X food, anouther ant will be born... It is alot of fun to program and you can redo it when you get OO programing and graphic programming...

Reikes
Reikes is offline  
Old 07-25-2003, 06:28 AM   #10 (permalink)
kel
WARNING: FLAMMABLE
 
Location: Ask Acetylene
or...

Instead of learning one of the pre-packaged windows systems, learn openGL which shouldn't take more then a week for basic 2d stuff, and write your own window code. You can do really great effects very easily with openGL. For fun you could mirror everything behind a semi-transparent plane to get really cool reflections, or you can add drop shadows or lighting. Once you have openGL you can build something more interesting then you could otherwise.
3d data structures will give you all the experience you need in designing data structures for almost any purpose. 3d algorithms on the other hand can be pretty difficult to understand, and if you actually wanted to learn how CG works you would need to take a course.

You might find it tempting to study direct3d or direct*, but they can be pretty daunting and are badly documented (IMO). Using any of microsofts tools is. They work in a fairly similar manner but direct* requires a ton of picky initialization code.

http://nehe.gamedev.net/
__________________
"It better be funny"

Last edited by kel; 07-25-2003 at 06:32 AM..
kel is offline  
Old 07-25-2003, 09:12 AM   #11 (permalink)
Tilted
 
Location: Ottawa, ON, Canada
The site kel mentioned is great, you can totally cut and paste the ugly stuff (good if you are a rank amateur at Windows API stuff, which is just about everyone on the face of the earth) And get into doing funky stuff with 3d graphics. Make your own screensavers, etc. It's fun.
human is offline  
Old 07-25-2003, 02:35 PM   #12 (permalink)
Crazy
 
I have a slightly different question. I have never programmed much (besides web design) and I want to learn C++. Where should I start, what is the first things I need to know and whats the quickest way to get started?
Fake Alias is offline  
Old 07-25-2003, 03:08 PM   #13 (permalink)
Tilted
 
Quote:
Originally posted by Fake Alias
I have a slightly different question. I have never programmed much (besides web design) and I want to learn C++. Where should I start, what is the first things I need to know and whats the quickest way to get started?
The quickest way to get started is to just sit down and work on something. There are so many types of things you could write. You may try to start on a native Windows app, but you'll probably want to get the basics down (pointers, classes, overall structure and logic).

A couple of projects that we used when I was a TA for a C++ class are a student database (where you can add, remove, and lookup students), and a small MUD (Multi-User Dungeon) game. The latter is a bit tough for a first project, but work your way toward something, step-by-step.

The first thing I would research are pointers. Write a simple C program that uses pointers. I'll give a quick intro here. A pointer variable (something like int *var or char *var) just points to an area in memory, e.g. another variable. This is a very important thing that you need to get the grasp of pretty much immediately. It will look confusing, but it's really not. It just takes some learning and getting used to. Remember that a "pointer" just points to something. Oh, and when you allocate memory, free it
ChipX86 is offline  
Old 07-27-2003, 11:18 AM   #14 (permalink)
Addict
 
Location: Ottawa, ON, Canada
Holy Cripes!

The guy just learned the fundamentals of programming, and most of you are already suggesting he get into things like OpenGL and DirectX. You're going to make his brain explode

You're probably going to want to stay away from those things for now, because they can be quite advanced, even when performing seemingly simple tasks. And just a quick example of how complicated it can get, putting a simple pixel on the screen using DirectX is a matter of initializing DirectDraw, setting the drawing mode, creating a primary surface (and any optional clippers), getting a pointer to the surface, locking it, and knowing where to enter the value representing the colour into the surface's buffer. Not something you should be doing when you're just learning the fundamentals of programming, especially when you add the fact that DirectX is written entirely using COM.

Instead, what you should really do is start out with simple programs. I think that <B>Edvard_Grieg</B> was on the right track with his hangman game, but I just think it uses too much file accessing and parsing, which tend to be more novice skills. If you're only at the point where you've just learned abstract data fundamentals and multidimensional arrays, I would start out even simpler.

You could start out by writing a calculator that takes in a formula and spits out a response. Then when you've done that, try writing a calculator that takes input in Polish notation (you'll have to look that one up on the Internet). However, this idea is almost too simple, and won't keep you busy for long.

Instead, a good suggestion would be to write a text based program that simulates a scenario of some sort. Simulations tend to be more focussed on the thought process (i.e. figuring out how to simulate the scenario), but still use a lot of fundamental programming skills during the implementation.

Two good suggestions from my college days:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-
1) A line at a bank.

Create a single queue at a bank, with X amount of tellers open to serve the bank customers. Each teller takes a random amount of time (say between 1 to 10 minutes) to serve a customer before they can service another customer.

Give the bank line twenty customers, and see how long on average it takes for the 20th customer to be served if there are 2 tellers, 3 tellers, 4 tellers, etc. up to 10 tellers.

This actually becomes an interesting exercise, because you should be able to see a point where the efficiency of the bank peaks, and adding more tellers no longer improves efficiencies.

2) The life of a forest

This one is nice, because it actually uses two dimensional arrays. Basically, the idea is to create a two dimensional array (the size is up to you), and each element in the array represents an area in a forest. The areas can have three states: T = Full of green trees, I = Infested with insects, and D = Deforested

When the forest is displayed on the screen, you advance the forest through time periods by pressing a key. The rules for moving the forest through a time period are as follows:
- any 'T' that has an adjacent 'I' will become an 'I'
- any 'I' will be changed into a 'D'
- any 'D' will be changed into a 'T' (I believe you're only supposed to change the 'D' after <B>two</B> time periods have elapsed, but if this doesn't give you desirable results, try switching it back to one time period)

You decide what I mean by 'adjacent', whether it's only on the four major compass points (N, E, W, S), or if it's all eight points. To start the simulation, initialize several different arrays with different scenarios, such as:

T T T T T
T T I T T
T I D I T
T T I T T
T T T T T

or

T T T T T
T I D I T
T D T D T
T I D I T
T T T T T

And let them run, outputting the new forest after every time period. You could even create a user interface that allows the user to choose amongst several scenarios, and keeps track of how many time periods have elapsed.

As an extended challenge, if you know how to do text programming, you could give each forest state its own colour (i.e. T is green, I is purple, and D is brown), and instead of drawing a new array on the screen underneath the old array everytime a time period elapses, overwrite the old array on the screen. This method actually gives a stunning effect of animation if you just skip the key pressing, and let it run automatically (with a delay() to slow things down a bit).

=-=-=-=-=-=-=-=-=-=-=-=-=-

These are just a couple of ideas that I could think of off the top of my head. I'm hoping I was clear enough in my examples, but if you need any elaboration, just let me know, and I'll try to give a better description.
__________________
"A witty saying proves nothing"
- Voltaire

Last edited by Quadraton; 07-27-2003 at 11:35 AM..
Quadraton is offline  
Old 07-27-2003, 07:12 PM   #15 (permalink)
Banned
 
Location: Greater Vancouver
Are you looking to exercise your algorithms or your syntax? Usually beginner-level exercises like you've requested work on one or the other

I'd suggest just getting a book from the library/googling - it's how I learned. They usually have pretty good examples and exercises, and they're also handy for reference.

I also took a computing competition when I was in high school - check it out here:
http://contest-cemc.uwaterloo.ca/ccc/index.html

They have many problems similar to the one Quadraton just posted. If I remember the contest correctly, the Junior-level problems would be about your skill level. You might need to learn file i/o, but that's fairly simple if you're already accustomed to screen i/o

C: fopen(), fclose(), fprintf()
C++: fstream open, close, <<, >>
Flippy is offline  
Old 08-07-2003, 07:31 AM   #16 (permalink)
Dead Inside
 
Location: East Coast, USA
If you are interested in programming competitions, try http://www.topcoder.com It's an on-line real-time programming contest site.

I really like it because it is quite reminiscent of programming contests I took part in when I was in college. I also like programming under time pressure because sometimes I get very anal and cannot get any coding done.

good luck and have fun.
alkaloid is offline  
Old 08-11-2003, 07:07 PM   #17 (permalink)
Crazy
 
Location: Salt Lake City
Make some money, that's what I'd do. After my first C++ class I decided to keep my skills sharp by writing a small game for the Pocket PC and selling it online. Sure hasn't made me rich, but it's a nice bonus income. Trust me, the best way to learn any skill is to make money doing it from the very start. It's the ultimate motivator.
__________________
---<>---^^---<>---^^---<>---
---^^---<>---^^---<>---^^---
---<>---^^---<>---^^---><---
GreasyP is offline  
Old 08-15-2003, 06:36 AM   #18 (permalink)
Insane
 
cowlick's Avatar
 
Location: Seattle
My suggestion for those who want to learn C or C++ is the same.
Read 'C Programming Language', by Kernighan and Ritchie. This book is the 'bible' of C programming. Be sure you can solve every problem in the book.

If you want some more, get a book like 'C++ How to Program' by Deitel and Deitel. Go through the book and complete all the excercises in there.

Learning to write software is about learning. It's not about producing great works. While academic excercises may not be as impressive as OpenGL based windowing modules, the academic excercises are designed to teach you what you need to know to construct software of any scope in any language.

I interview people trying to obtain jobs in the software industry, from college graduates to industry experts with 20+ years of experience. The quickest way to weed out the 90% of losers from the 10% of winners is to ask them a simple 101 or 102 programming question. I then get to stand in amazement as people with impressive resumees as long as a laundry list can't reverse a linked list.
__________________
"It's a long story," says I, and let him up.
cowlick is offline  
Old 08-15-2003, 05:00 PM   #19 (permalink)
Poo-tee-weet?
 
JStrider's Avatar
 
Location: The Woodlands, TX
well i forgot about this thread... and the summer is almost over... i havnt been doing much to keep up on the programing... just a little bit here and there... but Quadratons forest thing sounds like its doable... i think ill start tryin to work on it tonite or tomorow... least my parents would complain about not doing anything productive...
__________________
-=JStrider=-

~Clatto Verata Nicto
JStrider is offline  
 

Tags
brushed, keeping, skills, summer

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 10:12 PM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360