From: "Bart van den Burg" Newsgroups: comp.os.msdos.djgpp Subject: bool problem Date: Fri, 19 Oct 2001 20:33:33 +0200 Organization: XO Communications B.V. Lines: 64 Message-ID: <9qprh4$bqk$1@cyan.nl.gxn.net> NNTP-Posting-Host: asd-tel-ap01-d04-161.dial.freesurf.nl X-Trace: cyan.nl.gxn.net 1003516260 12116 62.100.3.161 (19 Oct 2001 18:31:00 GMT) X-Complaints-To: abuse AT freesurf DOT nl NNTP-Posting-Date: 19 Oct 2001 18:31:00 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com how comes the next following function always echoes "48" and in ----------- if (markMine && minesA[x-1][y-1] == 2) { drawCircle(x * 5 - 1, y * 5 - 1, 1, 4); mines--; } else if (!markMine) printNumber(x - 1, y - 1); ----------- markMine always seems to be false?? thx Bart ///////////////////////function: void playGame() { char x = -1; char y = -1; bool markMine = false; regel("MARK MINE ", 60, 54, backgroundColor); regel(" ", 80, 40, 1); regel(" ", 80, 47, 1); while (!(x >= 1 && x <= 9)) { x = getkey() - 48; if (x == 35) { markMine = !markMine; color = int(markMine); regel("MARK MINE ", 60, 54, color); } } char buffer[0]; sprintf(buffer, "%d", char(x)); regel(buffer, 80, 40, 1); while (!(y >= 1 && y <= 9)) { y = getkey() - 48; if (y == 35) { markMine = !markMine; color = int(markMine); regel("MARK MINE ", 60, 54, color); } } sprintf(buffer, "%d", char(y)); regel(buffer, 80, 47, 1); int temp = 0; do { temp = getkey(); } while (temp != 13); if (markMine && minesA[x-1][y-1] == 2) { drawCircle(x * 5 - 1, y * 5 - 1, 1, 4); mines--; } else if (!markMine) printNumber(x - 1, y - 1); sprintf(buffer, "%d", mines); regel(buffer, 82, 30, 1); mines = 0; cout << markMine; }