Let's create a program to generate square chessboards with a given dimension.
In the Solution class, you have a two-dimensional array of characters (the array field). Requirements:
- Read a number from the keyboard. This will be the dimension of our board (the length of a side);
- Initialize the arr
Chess board
- 6
Locked
Comments (7)
- Popular
- New
- Old
You must be signed in to leave a comment
Krig Raseri
9 August 2022, 07:22
Same issue as some other people where I have the right output, but it counts it wrong.
0
David Oh
27 July 2022, 08:11
I kept printing the chessboard directly instead of "painting" # and blank in the array first.. haha silly me
0
steven anthony kwong
1 February 2022, 18:49
This chessboard exercise taught me more about debugging. Its doable but its tricky. lots of patience required for me. very glad to have pass on my third go.
0
Anonymous #10904981
6 January 2022, 23:30
I wrote my chess board script in Intellij and was able to run it with the correct result but couldn't verify it with success. My code was not same as the correct solution but still. Either the conditions are badly written or the verify feature doesn't like it if code is really different compared to the correct solution.
+1
Roman
10 January 2022, 07:35
Please post your question with the attached solution in the section Help.
0
Hoist
27 October 2021, 02:23
seriously ? terribly challenge to comprehend ... when mentioning a chess board -- you might envision an 8 x 8 square --- this code runs / passes ?? and this is not an 8x8 chess board when input is 8 ... I just ran it so many times that I got it to pass .... WORKING CODE UP THERE haha 1) create an an array with # or space ' ' ... and then paint it back to the screen ...
0
Hoist
17 October 2021, 06:02
There is no help or even discussion within CG search on this at all ... what's up ? It would be great to better understand the thought behind the two code blocks walking thru.
0