• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tic tac toe format  RSS feed

 
Tomas Castagnino
Greenhorn
Posts: 28
3
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I bump into this format-like kind of question:

Given the following table...



...and the following code...

String [] [] table = new String[4][4];

table[0][0] = “X”;
table[2][2] = “X”;
table[1][3] = “X”;
table[4][4]  = “X”;
table[3][4] = “X”;

...what would be the right choice if you want to complete a line of Xs?

Then you had lots of options to choose from.

It was something like that... The point was to figure out which where the rows and which the columns. The right answer was table[4][0].

It was something like that, yes. But I remember it was a little bit less obvious than my example. In any case, you get the idea.

Regards!
 
Tomas Castagnino
Greenhorn
Posts: 28
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Edit: It should be String [] [] table = new String[5][5];

Sorry
 
Paul Anilprem
Enthuware Software Support
Ranch Foreman
Posts: 3991
32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the details, Tomas.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36659
475
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for sharing. That's a cool question format.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!