-1

I want something like this:

String Aa, Eb, Cc, Dd, Be, Ff = "1";
String Ba, Db, Ac, Ed, Fe, Cf = "2";
String Ea, Cb, Bc, Fd, Ae, Df = "3";
String Da, Ab, Fc, Bd, Ce, Ef = "4";
String Fa, Bb, Ec, Cd, De, Af = "5";
String Ca, Fb, Dc, Ad, Ee, Bf = "6";

But that doesn't work, It makes the last ones (Ff, Cf, Df, Ef, Af, and Bf), but the ones before that get ignored. Also, I don't want to make an array because the challenge (I'm in a class) was to program sudoku without using any forms of arrays.

Pshemo
  • 122,468
  • 25
  • 185
  • 269

2 Answers2

1

You will have to initialize each String, like this:

String Aa = "1", Eb = "1", Cc = "1", Dd = "1", Be = "1", Ff = "1";
...

An alternative would be this:

String Aa, Eb, Cc, Dd, Be, Ff;
Aa = Eb = Cc = Dd = Be = Ff = "1";
...
thatguy
  • 21,059
  • 6
  • 30
  • 40
0

Arrays are not valid for you,

so you can

Do like

String Aa = "1", Eb = "1"....;

or

String Aa = "1";
String Eb = "1";
...

much more flexible than that is not defined in the java language

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97