#### Archived

This topic is now archived and is closed to further replies.

# Impossible to pick up where I left off...

This topic is 5667 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I haven''t coded for one year now. For the last 3 months, I''ve been trying to get back into the habit of coding daily. However, I find this to be impossible for some reason. I can''t code a game in Allegro because I forgot what I knew. And on the other hand, I can''t sit down and read a book because I know most of it. This is really making me miserable. I wish some can give me some advice on what to do. Even if I do start reading some book. I can''t only read. I want something to code. Yet, nothing comes to mind. If I DO start reading a book, I have some to choose from. I would like it if someone can tell me which would be best for someone that knows how to program in general, yet forgot many important features of C++. The C Programming Language - K&R The C++ Programming Language - Stroustrup C++: The Complete Reference - Herbert Schildt Waite Group''s Object Oriented Programming in C++ - Robert Lafore Teach Yourself C++ in 21 Days (3rd) - Jesse Liberty Practical C++ Programming - Steve Oualline Any help or suggestions will be greatly appreciated. Thanks.

##### Share on other sites
What''s up with the double post?

##### Share on other sites
You hit the button twice, it double posts. Now I believe you can click "edit" and delete one.

I started learning C++ with "Teach Yourself C++ in 21 Days", but I wouldn''t actually suggest it. Seems to go from really simple to stupidly complex, skipping out any middle ground to lead you through it. Good if you can grasp the concepts extremely quickly, but I''m thinking of buying another book...

------------
http://aud.vze.com <-- Newbie alert, look at your own risk. Can induce severe laughing fits and other variations of hysterical outburst.

##### Share on other sites
Sometimes interests wane without our control, too.

Maybe you should take stock on the idea of whether or not you really want to code. If you''re having a hard time focussing on getting back into it, that might mean something.

However, if you are truly set on doing it, you''ll find a way back eventually, don''t worry.

##### Share on other sites
I would suggest coding something *simple* yet *useful* to you. I mean, coding for coding is fine, but it''s always great when the programs you write are actually useful to you in some way, such as a calendar, some sort of screensaver, or maybe something to all-around make things easier for you on your computer.

##### Share on other sites
I would recommend "The C Companion" by Allen Holub. Covers - compiler theory, assembly language, advanced pointers, recursion, and debugging.

-------------------
The Reindeer Effect
Insomniac Software

##### Share on other sites
I think the books are my problem actually... I do nothing but read them. I need to start writing small programs in between, rather than reading the text non-stop. Hmmm.. What supplemental programs are there to make though after reading a section? :/ Also, at what rate should I be reading each section/chapter?

Thanks.

##### Share on other sites
If you say you know most of the book and that''s why you aren''t reading it, do you mean a C/C++ book?
Because if you did know how to program and simply forgot, it shouldn''t be too hard getting back.
Why not skim through the book a bit, look at some source code, and spend some time coding the parts/features you know less about while reading about them?

Reading alone will not get you very far.
Coding is compulsory in order to learn.
Even if you copy the examples from the book, try changing them and playing around with the a bit - ''What happens if I change this?''. - Experiment as much as you like.
Whatever you write doesn''t have to be a useful program or anything fancy - as long as you learn from it, consider it useful.
If you can find a purpose for your programs - the better.
Otherwise, just program using as many features as possibles from what you have learned. As long as you understand what''s going on in there, who cares what the output is or how useful the program is if at all.

Hope this helps.

##### Share on other sites
You shoould code what you learn, maybe the things you already know. Like when (re)learning recursion or classes, you could write a program that uses pointers and loops too.....

##### Share on other sites
quote:
Original post by Arkainium
I haven''t coded for one year now. For the last 3 months, I''ve been trying to get back into the habit of coding daily.

However, I find this to be impossible for some reason. I can''t code a game in Allegro because I forgot what I knew. And on the other hand, I can''t sit down and read a book because I know most of it.

This is really making me miserable. I wish some can give me some advice on what to do.

Even if I do start reading some book. I can''t only read. I want something to code. Yet, nothing comes to mind.

If I DO start reading a book, I have some to choose from. I would like it if someone can tell me which would be best for someone that knows how to program in general, yet forgot many important features of C++.

The C Programming Language - K&R
The C++ Programming Language - Stroustrup
C++: The Complete Reference - Herbert Schildt
Waite Group''s Object Oriented Programming in C++ - Robert Lafore
Teach Yourself C++ in 21 Days (3rd) - Jesse Liberty
Practical C++ Programming - Steve Oualline

Any help or suggestions will be greatly appreciated.
Thanks.

Not to dissappoint you or anything but it''s just not feasible to drop something for a year, then come back and expect to remember everything. A boxer doesn''t stop boxing and training then come back to the ring and expect to win a fight. And if he''s sat on his butt drinking milk shakes, and eating french fries for the past year you can bet he''s fat, out of shape and probably needs to start his training all over again. This is where your at. It''s time to start over, this time you''ll move at a quicker pace but you still need to spend time doing the "lame programs" in order for your previous knowledge to return. Or you''ll be biting the ears of your peers asking for help for quite some time.

##### Share on other sites
C++: The Complete Reference 3rd Edition (sp?) By Hebert Shildt...

Its in a reference format but its in an order so that a newbie can pick it up and know C++ after hes done with it...

At the beginning, he assumes that you have a background with some C++... but he explains everything...

(This is a personal experience)

##### Share on other sites
quote:
Original post by Anonymous Poster
Not to dissappoint you or anything but it''s just not feasible to drop something for a year, then come back and expect to remember everything. A boxer doesn''t stop boxing and training then come back to the ring and expect to win a fight. And if he''s sat on his butt drinking milk shakes, and eating french fries for the past year you can bet he''s fat, out of shape and probably needs to start his training all over again. This is where your at. It''s time to start over, this time you''ll move at a quicker pace but you still need to spend time doing the "lame programs" in order for your previous knowledge to return. Or you''ll be biting the ears of your peers asking for help for quite some time.

Now that I look at it, you''re absolutely right. I guess I''m going to have to start from the beginning again. Well, I guess I''ll start reading C++: The Complete Reference (Schildt) since penguin recommends it. However, I won''t master anything unless I write programs along with reading the text. The only text-based programs I can really think of are check-book/bank programs and text adventures.

Can anyone give a list of text-based programs that I could write while reading a book to perfect my skills?

Thanks.

##### Share on other sites
Data structures ie. linked lists, stacks, deques, etc and patterns like singletons etc. Learn the searches and sorts too. If you are good at all these things, everything else will be easier. At least that has been my experience.

##### Share on other sites
Interesting Text-based:
- Tic-tac-toe
- type the falling letters b4 it reach the ground (keyboard typing exercise)
- calculator that support parenthesis, and +-*/
- advance calculator that have function
- even more advance calculator that can have algebraic expresion
- editor (similar to EDIT.COM) or better with spelling checker
- spelling checker for text file only
- simple file managers (eg. Norton Commander, console RAR-like)

..... and so on. There are limitless possibilities. One thing... learn the Console handling functions for Win32.. if u wanna go text bezerk.

##### Share on other sites
quote:
Original post by DerekSaw
Interesting Text-based:
- Tic-tac-toe
- type the falling letters b4 it reach the ground (keyboard typing exercise)
- calculator that support parenthesis, and +-*/
- advance calculator that have function
- even more advance calculator that can have algebraic expresion
- editor (similar to EDIT.COM) or better with spelling checker
- spelling checker for text file only
- simple file managers (eg. Norton Commander, console RAR-like)

..... and so on. There are limitless possibilities. One thing... learn the Console handling functions for Win32.. if u wanna go text bezerk.

Wow! Thanks for all the ideas.

##### Share on other sites
Can I suggest one thing too:

##############           ##   @       ##           ##           ##           ##           ##############

The @-thingy can move in the white space, but not on the #-terrain.

Hmm... can someone tell me if the "Windows Console Functions" can plot letters to different positions easily (something like LOCATE in BASIC, for example). And is it faster to use those functions to clear the screen (faster than system(cls) ?

- I want to make a game like Nethack but better

##### Share on other sites
quote:
Original post by Pegu
Can I suggest one thing too:

##############           ##   @       ##           ##           ##           ##           ##############

The @-thingy can move in the white space, but not on the #-terrain.

Thats a great way to make a text game and I like the idea, but is it possible to position the text in Standard C++? If so, how?

Thanks.

##### Share on other sites
that reminds me of angband. It''s c source is available online, i forget where.

##### Share on other sites
I made this because I dont know how to do graphics..
#include<iostream.h>// for cout#include<conio.h>// for gotoxy, getchint canmap(int mx,int my);void drawmap(int mapx, int mapy);const char you=''X'';const viewx=30,viewy=20;const msx=55,msy=35;const posx=10,posy=10;//             r ,dr,d ,dl,l ,ul,u ,urint xmove[8]= {+1,+1, 0,-1,-1,-1, 0,+1};int ymove[8]= { 0,+1,+1,+1, 0,-1,-1,-1};int keydir[8]={54,51,50,49,52,55,56,57};char map[msy][msx]={{"111111111111111111111111111111111111111111111111111111"},{"1                                      1 ~~~~~~~~~~~~~~"},{"1                                      1 ~~~~~~~~~~~~~~"},{"1                                      1 ~~~~~~~~~~~~~~"},{"1             111111111111             1 ~~~~~~~~~~~~~~"},{"1             1     1    1             1 ~~~~~~~~~~~~~~"},{"1             1     1    1             1 ~~~~~~~~~~~~~~"},{"1             1     1    1             1 ~~~~~~~~~~~~~~"},{"1             1=====1    1             1 ~~~~~~~~~~~~~~"},{"1             1          1             1 ~~~~~~~~~~~~~~"},{"1             1          1             1 ~~~~~~~~~~~~~~"},{"1             1          1             1 ~~~~~~~~~~~~~~"},{"1             11111111   1             1 ~~~~~~~~~~~~~~"},{"1                                      1 ~~~~~~~~~~~~~~"},{"1                                      1 ~~~~~~~~~~~~~~"},{"1                                      1 ~~~~~~~~~~~~~~"},{"1                                      1 ~~~~~~~~~~~~~~"},{"1                                      1 ~~~~~~~~~~~~~~"},{"1                                     11 ~~~~~~~~~~~~~~"},{"1                                    11  ~~~~~~~~~~~~~~"},{"1                                   11  ~~~~~~~~~~~~~~~"},{"1                                  11   ~~~~~~~~~~~~~~~"},{"1                                 11   ~~~~~~~~~~~~~~~~"},{"1                                 1    ~~~~~~~~~~~~~~~~"},{"1                                 1    ~~~~~~~~~~~~~~~~"},{"1                                 1    ~~~~~~~~~~~~~~~~"},{"1                                 1    ~~~~~~~~~~~~~~~~"},{"1                                 1    ~~~~~~~~~~~~~~~~"},{"1                           11  111    ~~~~~~~~~~~~~~~~"},{"1                           1          ~~~~~~~~~~~~~~~~"},{"1                           1      1   ~~~~~~~~~~~~~~~~"},{"1                           1 11111    ~~~~~~~~~~~~~~~~"},{"1                           1 111111   ~~~~~~~~~~~~~~~~"},{"1                           1  111111  ~~~~~~~~~~~~~~~~"},{"11111111111111111111111111111~~~~~~~~~~~~~~~~~~~~~~~~~~"}};int x=1,y=1;/////////////////////////////////////////MAINvoid main(){	int fx,fy,f;	int key;	top:	for(fy=0;fy<viewy;fy++){		for(fx=0;fx<viewx;fx++){			drawmap(x+fx,y+fy);		}	}	for (fx=0;fx<viewx;fx++){		gotoxy(fx,viewy);		cout<<''-'';	}	for (fy=0;fy<viewy;fy++){		gotoxy(viewx,fy);		cout<<''|'';	}	gotoxy(viewx,viewy);	cout<<''/'';	gotoxy(posx,posy);	cout<<you;	gotoxy(1,1);	while(1){		key=getch();		for(f=0;f<8;f++){			if (key==keydir[f] && map[y+posy+ymove[f]][x+posx+xmove[f]]!=''1''){				x=x+xmove[f];				y=y+ymove[f];				goto top;			}		}		if (key==27) return;	}}/////////////////////////////////////////DRAWMAPvoid drawmap(int mapx, int mapy){	char print=0,mm;	gotoxy(mapx-x,mapy-y);	if(mapx<0 || mapy<0 || mapx>=msx || mapy>=msy){		print=0;	}else{		print=map[mapy][mapx];	}	cout<<print;}

##### Share on other sites
How to move the cursor around and all kinds of other neat stuff (such as resizing the console window or scrolling it or coloring text) look in the MSDN library under

(Visual Studio 6)
Platform SDK/Windows Base Services/Files and I/O/Console and character mode support/

(Online)
search for "console AND cursor" at MSDN and you will get there.

There is, for isntance, a win32 API function called SetConsoleCursorPosition()

##### Share on other sites
Wow!

Thanks for all the replies.

I have to search for some information about conio.h - haven''t seen it in any of my books. Probably because it''s not part of the standard. Now that I see that you can do a lot of cool stuff with it, especially setting the position of text, I''m going to look into it.

This opens a lot of doors. Now I will be able to design some ASCII games. :D

Thanks a lot guys.

BTW: If you know any more libraries/headers that have similar functions to conio.h, please tell me. This way I will build greater C++ experience before going back to Allegro, or just going straight to Win32 and DirectX.

Thanks, again.

• ### Forum Statistics

• Total Topics
628653
• Total Posts
2984054

• 10
• 9
• 9
• 10
• 21