Minesweeper Dev C++
I'm doing this minesweeper assignment and I need help. I tried to test the findMineValues() function and it completely scrambles up my board. Can someone help me pinpoint what I am doing wrong?
Minesweeper Online
- 2 Contributors
- forum 5 Replies
- 914 Views
- 14 Hours Discussion Span
- commentLatest Postby DeadJusticeLatest Post
VernonDozier2,218
Minesweeper in c. Contribute to mukund26/minesweeper development by creating an account on GitHub. May 17, 2013 Minesweeper game project. Hello, I have just joined this community, wanting to be better in programming using c. About minesweeper.can't really recall. Oct 27, 2009 The C Program: minesweeper.cpp 1 /. 2. minesweeper.cpp 3. 4. Created on: Oct 27, 2009 5. Author: Brianna 6./ 7 8 #include 9 #include 10 #. Minesweeper c free download. Eagle Mode Eagle Mode is a zoomable user interface (ZUI) with file manager, file viewers, games, and more.
Dev C++ For Windows 10
Please be more specific about what the problem is. What is this function supposed to do and what does 'it completely scrambles up my board' mean?
Right now it doesn't do anything as far as I can tell. You have a void function that declares and changes a local variable called numMines
, then never does anything with numMines
. You have a function call that DOES do something with numMines
, but it is commented out.
As a side note, on lines like this:
Griddles, cookers, gas stands, ovens and tons of utensils like pots, pans, plates, knives, spatulas and blenders! There’s also a full set of spices and herbs for adding that extra flavour!Lifelike cooking experience! Download cooking. On top of that there are over 120 ingredients available in the pantry: meat and fish, fruit and veggies, dairy products and various liquids.
you can leave true
off and it'll be the same code.
Dev C++ Online
- {
- int theone;
- int extra2=0;
- char char2;
- char flag='n';
- int x;
- int count=30;
- srand (time(NULL));
- vector<char>cover;
- vector<int>waiter;
- vector<char>chars;
- for(int i=0;i<261;i++)
- waiter.push_back(0);
- mines.push_back(0);
- cover.push_back('+');
- cout<<'n';
- {
- y=x%260+1;
- if(mines[y]0)
- mines[y]=1;
- else
- i--;
- }
- {
- chars[i]='M';
- x=0;
- if(chars[1]!='M') //top left
- if(chars[2]'M')
- nums[1]++;
- if(chars[27]'M')
- nums[1]++;
- if(chars[28]'M')
- nums[1]++;
- }
- if(chars[26]!='M') //top right
- if(chars[25]'M')
- nums[26]++;
- if(chars[51]'M')
- nums[26]++;
- if(chars[52]'M')
- nums[26]++;
- }
- if(chars[235]!='M') //bottom left
- if(chars[209]'M')
- nums[235]++;
- if(chars[210]'M')
- nums[235]++;
- if(chars[236]'M')
- nums[235]++;
- }
- if(chars[260]!='M') //bottom right
- if(chars[233]'M')
- nums[260]++;
- if(chars[234]'M')
- nums[260]++;
- if(chars[259]'M')
- nums[260]++;
- }
- for(int i=2;i<26;i++) //top
- if(chars[i]!='M')
- if(chars[i-1]'M')
- if(chars[i+1]'M')
- if(chars[i+25]'M')
- if(chars[i+26]'M')
- if(chars[i+27]'M')
- }
- {
- {
- nums[i]++;
- nums[i]++;
- nums[i]++;
- nums[i]++;
- nums[i]++;
- }
- for(int i=26;i<210;i++) //left
- if(i%261&&chars[i]!='M')
- if(chars[i-26]'M')
- if(chars[i-25]'M')
- if(chars[i+1]'M')
- if(chars[i+26]'M')
- if(chars[i+27]'M')
- }
- {
- {
- nums[i]++;
- nums[i]++;
- nums[i]++;
- nums[i]++;
- nums[i]++;
- }
- for(int i=28;i<234;i++) //all else
- if(i%26!=0&&i%26!=1&&chars[i]!='M')
- if(chars[i-27]'M')
- if(chars[i-26]'M')
- if(chars[i-25]'M')
- if(chars[i-1]'M')
- if(chars[i+1]'M')
- if(chars[i+25]'M')
- if(chars[i+26]'M')
- if(chars[i+27]'M')
- }
- {
- chars[i]='1';
- chars[i]='2';
- chars[i]='3';
- chars[i]='4';
- chars[i]='5';
- chars[i]='6';
- chars[i]='7';
- chars[i]='8';
- while(1)
- cout<<'nnMines left: '<<count<<'nn a b c d e f g h i j k l m n o p q r s t u v w x y zn ---------------------------------------------------n 0 ';
- for(int i=0;i<260;i++)
- if(cover[i+1]'+')
- else
- if(i%2625&&num!=10)
- cout<<' '<<num-1<<'n '<<num<<' ';
- }
- }
- cout<<' 9n ---------------------------------------------------n a b c d e f g h i j k l m n o p q r s t u v w x y z';
- cout<<'nnChoose a space: ';
- if(char1'F')
- cin>>char3;
- char2=char3;
- count--;
- wait=1;
- extra1=1;
- extra1=2;
- extra1=3;
- extra1=4;
- extra1=5;
- extra1=6;
- extra1=7;
- extra1=8;
- extra1=9;
- extra1=10;
- extra1=11;
- extra1=12;
- extra1=13;
- extra1=14;
- extra1=15;
- extra1=16;
- extra1=17;
- extra1=18;
- extra1=19;
- extra1=20;
- extra1=21;
- extra1=22;
- extra1=23;
- extra1=24;
- extra1=25;
- extra1=26;
- if(char2'0')
- else if(char2'1')
- else if(char2'2')
- else if(char2'3')
- else if(char2'4')
- else if(char2'5')
- else if(char2'6')
- else if(char2'7')
- else if(char2'8')
- else if(char2'9')
- if(flag'y')
- chars[theone]='F';
- cover[theone]='-';
- waiter[wait]=theone;
- while(wait!=0&&flag'n')
- if(chars[theone]'0')
- if(theone1) //top left
- {
- waiter[wait]=2;
- cover[2]='-';
- {
- waiter[wait]=27;
- cover[27]='-';
- {
- waiter[wait]=28;
- cover[28]='-';
- if(theone26&&cover[26]'+') //top right
- if(nums[25]0&&cover[25]'+')
- wait++;
- }
- if(nums[51]0&&cover[51]'+')
- wait++;
- }
- if(nums[52]0&&cover[52]'+')
- wait++;
- }
- }
- {
- {
- waiter[wait]=209;
- cover[209]='-';
- if(nums[210]0&&cover[210]'+')
- wait++;
- }
- {
- waiter[wait]=236;
- cover[236]='-';
- }
- {
- {
- waiter[wait]=233;
- cover[233]='-';
- if(nums[234]0&&cover[234]'+')
- wait++;
- }
- {
- waiter[wait]=259;
- cover[259]='-';
- }
- {
- {
- {
- waiter[wait]=i-1;
- cover[i-1]='-';
- {
- waiter[wait]=i+1;
- cover[i+1]='-';
- {
- waiter[wait]=i+25;
- cover[i+25]='-';
- {
- waiter[wait]=i+26;
- cover[i+26]='-';
- {
- waiter[wait]=i+27;
- cover[i+27]='-';
- }
- for(int i=236;i<260;i++) //bottom
- if(theonei)
- if(nums[i-1]0&&cover[i-1]'+')
- wait++;
- }
- {
- waiter[wait]=i+1;
- cover[i+1]='-';
- if(nums[i-25]0&&cover[i-25]'+')
- wait++;
- }
- if(nums[i-26]0&&cover[i-26]'+')
- wait++;
- }
- if(nums[i-27]0&&cover[i-27]'+')
- wait++;
- }
- }
- for(int i=26;i<210;i++) //left
- if(i%261&&theonei)
- if(nums[i-26]0&&cover[i-26]'+')
- wait++;
- }
- if(nums[i-25]0&&cover[i-25]'+')
- wait++;
- }
- {
- waiter[wait]=i+1;
- cover[i+1]='-';
- {
- waiter[wait]=i+26;
- cover[i+26]='-';
- {
- waiter[wait]=i+27;
- cover[i+27]='-';
- }
- {
- {
- {
- waiter[wait]=i-27;
- cover[i-27]='-';
- {
- waiter[wait]=i-26;
- cover[i-26]='-';
- {
- waiter[wait]=i-1;
- cover[i-1]='-';
- {
- waiter[wait]=i+25;
- cover[i+25]='-';
- {
- waiter[wait]=i+26;
- cover[i+26]='-';
- }
- {
- {
- {
- waiter[wait]=i-27;
- cover[i-27]='-';
- {
- waiter[wait]=i-26;
- cover[i-26]='-';
- {
- waiter[wait]=i-25;
- cover[i-25]='-';
- {
- waiter[wait]=i-1;
- cover[i-1]='-';
- {
- waiter[wait]=i+1;
- cover[i+1]='-';
- {
- waiter[wait]=i+25;
- cover[i+25]='-';
- {
- waiter[wait]=i+26;
- cover[i+26]='-';
- {
- waiter[wait]=i+27;
- cover[i+27]='-';
- }
- }
- theone=waiter[wait];
- }
- }