Write a program that randomly fills in 0’s and 1’s into an 8 X 8 checker board,

vimmi

Honorable
Sep 11, 2012
2
0
10,510
Write a program that randomly fills in 0’s and 1’s into an 8 X 8 checker board, prints the board, and finds the rows, columns or diagonals with all 0’s or 1’s
 

Sunius

Distinguished
Dec 19, 2010
390
0
19,060
Say R is row number, and C is column number. Let's say checker board is represented in 2-dimension array.

For even results of R + C, you want to fill it with zeroes (0, 2, 4, etc) and for odd results of R + C, you want to fill it with ones (1, 3, 5, etc).

Just loop through all the array members and fill it!
 

Sunius

Distinguished
Dec 19, 2010
390
0
19,060
This is written as the top topic of this forum:

Read before asking for programming assignment help
Before you post a thread asking for help with your homework, please follow these simple instructions so that you can help us help you:


1. State at the beginning of your post that it is an assignment. Don't pretend that you are solving a problem in a professional application.


2. Don't post your programming assignment and just expect to be given the code to solve it. You usually won't get it.


3. Post some code that you have already written (yes you, not somebody else) and describe how you've gone about solving the problem already.


4. Describe what you are trying to do and what the problems are in detail. We can't read your mind.


5. Use the forum's [ code ] and [ /code ] tags (without spaces) to wrap any code that you post. It will preserve formatting and make it much easier to read.


6. Don't always expect to be given the complete solution. You may be given a partial solution or just some guidance to help you in the right direction. Ultimately, you are being marked on how well you understand what you're doing, not us. We don't just want you to understand how to copy and paste!

So no, I cannot give you code. However, if you start it yourself, I may be able to correct it.
 

randomizer

Distinguished


Thanks for saying "please", but no, we can't do your assignment for you. That doesn't help you understand anything.

If you make an attempt at it yourself we can guide you to the solution (guide, not give). The first two requirements are very simple. The last one will require a bit more thought.