Advertisement

I need exercises!!!

Started by March 25, 2002 03:49 PM
3 comments, last by rhino2876 22 years, 7 months ago
Call me strange if you''d like, but one thing that I am realizing in this learning to game program thing is that I need programming exercises in order to learn. I don''t learn from the books that require reading and show you examples. I do learn from the books that have exercises at the end of every chapter. Right now, I''m trying to learn Windows Programming. I know C++ now and am trying to move on. The trouble with this is that all the Windows Programming books that I''ve found don''t have exercises at the end of each chapter. Anyone know of any? If not, please post some ideas of what exercises I could do. I guess I get bored when reading is the only thing happening in my learning process. Anyways, start at the beginning of windows programming. I prefer examples that are explained clearly and require clear results (For example, I don''t like exercises that say, "Experiment with the style flags" - a clearly stated exercise would say, Change the style of the window to something specific). Some good ones that I found in the For Dummies book, are (with some added verbatim to make the exercises more clear): 1. Create a window. Give it a size of 400 by 200. Change the position of the window so that it is exactly centered on your screen. 2. Create a window. Change the window''s title to read "My Window". 3. Create a window. Change the background color to Light Gray. 4. Create a window. Change the icon to the hand-shaped icon. Change the cursor to the Crosshair Icon. 5. Create a window. Put up a message box when the window is created, moved, or sized. Another one that I thought of for when I get a little more advanced anyways (can''t do this yet): 6. Create a window with a menu item that allows you to change the size of the window to 320 x 200, 640 x 480, 800 x 600, 1024 x 768, and Full Screen (without borders). Have each option also have keyboard controls (a, b, c, d, e respectively) to switch between window sizes. This one could be fun to add to, such as: 7. Using the window in exercise 6, ...
Rhino2876
Why dont u try a paint program... Thats quite open ended! You could start with opening, saving, brush, lines, boxes, airbrush and go onto more advanced options like fills and effects.


Good luck,
bangz.
Advertisement
Personally, I like the treadmill. Sometimes I lift weights or do situps...er...

Well actually excercises like that are valuable too for programming, but I don''t think thats quite what you mean! =D

Try to make a small Space Invaders clone with GDI. That''s what I did. =D

Step 1: Make a window, and figure out how to blit to it
Step 2: Make a spaceship that you can move left to right
Step 3: Make it so the spaceship can fire something
Step 4: Make it so the spaceship can fire many things
Step 5: Make an enemy
Step 6: Make many enemies

There, you''re done then! =D
Well, I don''t know how much you''ve already learn''t about windows programming, but try:
1) Create a window, and create a button on the window. When the button is pressed, display a message box saying "Thank you for clicking this button "

2) Starting with the code from exercise 1, add another button to your window. This button should be labeled "close", and when it is pressed, it should exit the application.

3) Using the code from exercise 2 apply the following modifications:
- Add a text box to the window, and set it up so that it starts off displaying "Type here."
- Modify your first button (the one made in exercise 1), so that when pressed, it displays a message box displaying the current contents of the edit box.

4) Using the code from exercise 3, create a best-selling text-based RPG, using natural language systems to allow the user to enter commands in plain english (or whatever your first language is). (OK, that one was a joke - don''t even think about trying to make something like that until you understand windows programming much better)

The problem is that I just don''t know what stage you''re at - these might be really easy (= boring), or they might be really hard (= frustrating/impossible), or they might be just right (= an extreem coincidence).

Unfortunately, I can''t point you to any books, because I don''t use C++ (I therefore don''t use C++ books).

But you seem to be able to think of your own exercises pretty well, or is number 6 the only one you can think of on your own?

There''s nothing wrong with doing your own exercises (ones you thought of yourself) - you may find it more rewarding than just doing things out of a book.

John B
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
Make the Start button a scroll Text, ie. "GameDev.net" over and over, sorta like the winamp taskbar text. I only made this work under XP though, I think it''s definitly harder to do in Win2K.

Have fun

PS: Here''s another one: Make the Foreground window shake every minute or when the user presse a certain key...
Alternatively make the mouse shake/sway/whatever...

These exeercises are in general of no use but they are incredibly fun to try out at your friends PC''s. Trust me on that one ;-)

- Sleepwalker
- Sleepwalker

This topic is closed to new replies.

Advertisement