Advertisement

Impossible to pick up where I left off...

Started by June 02, 2002 09:51 PM
19 comments, last by Arkainium 22 years, 6 months ago
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)
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.
Advertisement
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.
Lucas Henekswww.ionforge.com
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.
"after many years of singularity, i'm still searching on the event horizon"
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.
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
Advertisement
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.

that reminds me of angband. It''s c source is available online, i forget where.
Lucas Henekswww.ionforge.com
I made this because I dont know how to do graphics..
num pad to move
#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;} 

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()
Jacob Marner, M.Sc.Console Programmer, Deadline Games

This topic is closed to new replies.

Advertisement