As u can see its not finished yet, i want to put up more levels. Thanx dwks.
As u can see its not finished yet, i want to put up more levels. Thanx dwks.
You're trying to get that code to hide the cursor? Just stick adrianxw's code near the beginning of main().
BTW, the preprocessor automatically concatenated strings together:
->Code:<<" LL EEEEEEE VV VV EEEEEEE LL 1 \n" <<" LL EE VV VV EE LL 111 \n" <<" LL EEEEE VV VV EEEEE LL 11 \n" <<" LL EE VV VV EE LL 11\n" <<" LLLLLLL EEEEEEE VVV EEEEEEE LLLLLLL 111\n"
Code:<<" LL EEEEEEE VV VV EEEEEEE LL 1 \n" " LL EE VV VV EE LL 111 \n" " LL EEEEE VV VV EEEEE LL 11 \n" " LL EE VV VV EE LL 11\n" " LLLLLLL EEEEEEE VVV EEEEEEE LLLLLLL 111\n"gotoxy() is declared in <conio.h> in Dev-C++.Code:void gotoxy(int x, int y) // ky funksion sherben per me shkru ne kordinaten e caktume
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
And try to get out of the habit of using goto.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
I would suggest storing your levels in a file. Then when you change them you don't have to compile your program. It would also mean that other people would be able to create levels. And it would also tidy up your code a bit.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
There are better ways of doing this.Code:if (x==45 && y==8 || x==39 && y==10 || x==52 && y==7 || x==43 && y==14 || x==45 && y==8 || x==19 && y==11 || x==21 && y==8 || x==41 && y==8 || x==45 && y==14 || x==32 && y==13 || x==35 && y==4 || x==35 && y==5 || x==35 && y==6 || x==35 && y==7 || x==35 && y==8 || x==35 && y==9 || x==36 && y==9 || x==37 && y==9 || x==38 && y==9 || x==35 && y==10 || x==35 && y==11 || x==35 && y==12 || x==35 && y==14 || x==35 && y==15 || x==35 && y==16 || x==35 && y==17|| x==35 && y==18 || x==35 && y==19 || x==54 && y==6 || x==52 && y==12 || x==51 && y==13 || x==54 && y==9 || x==54 && y==8 ) goto gameover;
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
I know that there are much shorter ways, but for the moment i learnt Functions, Pointers & Arrays. So i came up to the idea that i can make something only with these. So i dont know how to do that with files, and niether do i know how to make it easier and shorter. But i like chalanges. So this cursor thing is killing me. I did as you said it doesnt work. If ur bored with me feel free to say NO TIME PAL. If you want i can send you the library console.h that maybe u dont have try to compile it and you will see the results.
I don't see any code in there that even tries to hide the cursor. As I said, add adrianxw's code to the beginning of main.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
I did. I just sent you the one without it so u can judge where to put it. In the Int Main() ive put it in the very begining. And the result Remains the SAME.
And my code works?
Wait! I know! Maybe your other functions like gotoxy and fullscreen set the cursor back again.Code:#include <windows.h> #include <iostream> int main(void) { HANDLE hOut; CONSOLE_CURSOR_INFO ConCurInf; hOut = GetStdHandle(STD_OUTPUT_HANDLE); ConCurInf.dwSize = 10; ConCurInf.bVisible = FALSE; SetConsoleCursorInfo(hOut, &ConCurInf); std::cout << "The cursor should be gone.\n"; std::cin.get(); hOut = GetStdHandle(STD_OUTPUT_HANDLE); ConCurInf.dwSize = 10; ConCurInf.bVisible = TRUE; SetConsoleCursorInfo(hOut, &ConCurInf); return 0; }
Try putting the cursor hiding code after that stuff.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
I tryed. Still not working. Its interesting, when i make it TRUE and enlarge it it works. It only doest want to dissapear.
That's odd. And my programs works?
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
That CODE works that u've sent me anywhere. Just not in this game im making.
Well then it might be your other functions. I don't know.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
dwks thanx man very very much, although it doesnt work. It works on the other codes. Thanx once more for wasting your time with my problems. Im learing intesivly so i hope one day i can contribute to this forum with answers like you.