Mar 8, 2011 at 2:16pm UTC
GUys, Im a newbie here , can you give me some problems. to solve that can help me practice
Mar 8, 2011 at 2:20pm UTC
thanks ^^ i really appreciate it,
Mar 8, 2011 at 2:28pm UTC
I spent a few hours writing a console-based, minesweeper-like game the other day. It was a neat little project and would be about right for beginners.
The skills involved were:
- vectors/arrays
- for loops
- validating/parsing user input
- integer to string conversion
- stream padding
- recursion
Polymorphism could be used, if you really wanted to do a class job on it (pun intended).
Last edited on Mar 8, 2011 at 3:14pm UTC
Mar 8, 2011 at 2:29pm UTC
I use stdio.h not familiar with iostream.h
Mar 8, 2011 at 2:32pm UTC
@moorecm
what are the steps/instructions . i try to do that .
Mar 8, 2011 at 3:10pm UTC
Have you played Minesweeper? Just draw a labeled grid and prompt the user for the cell to "click".
For example:
0 1 2 3 4 5 6 7 8 9
--- --- --- --- --- --- --- --- --- ---
A |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
B |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
C |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
D |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
E |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
F |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
G |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
H |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
I |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
J |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
Choose a cell: A2
0 1 2 3 4 5 6 7 8 9
--- --- --- --- --- --- --- --- --- ---
A | 1 | 1 | | 1 |###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
B |###| 1 | | 1 | 2 |###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
C |###| 1 | | | 1 |###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
D |###| 1 | 1 | 1 | 1 |###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
E |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
F |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
G |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
H |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
I |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
J |###|###|###|###|###|###|###|###|###|###|
--- --- --- --- --- --- --- --- --- ---
Choose a cell:
...
What's nice about this project is that when you are done you can try to write a GUI for it.
Last edited on Mar 8, 2011 at 3:11pm UTC
Mar 8, 2011 at 11:06pm UTC
thanks for the Idea,,,
can you give me a brief instruction //steps
Last edited on Mar 8, 2011 at 11:09pm UTC
Mar 8, 2011 at 11:29pm UTC
Well now, you wanted a challenge =D
Next challenge, create your next c++ program without any instructions or steps!
Mar 8, 2011 at 11:45pm UTC
Geric: stdio.h is C, not C++. Sure you're in the right board here (well, of course you are, most C problems also apply to non-OO C++, just making sure you know the difference between C and C++).
Mar 9, 2011 at 3:13am UTC
@ultifinitus Yeah ^^ I'll try ,
@hanst99 c++ is the ++ of c , ,
Mar 9, 2011 at 5:03am UTC
Hah. I wish it were that simple.
There's a C and a C++ way of doing things, and the philosophies are not strict super/subsets of each other. Although C++ tries to be backwards-compatible with C and mostly manages, the philosophy changes between the two (example: prefer iostream over stdio in C++).
-Albatross
Mar 9, 2011 at 5:44am UTC
T T
yah .. @albatross -- i`m aware of that ,
not that affected right now , im still a newbie /and codes simple ones
Last edited on Mar 9, 2011 at 5:54am UTC