📄 sudokuboard_text.java
字号:
// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov Date: 2/13/2008 10:19:21 PM
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: SudokuBoard_Text.java
import java.io.PrintStream;
class SudokuBoard_Text
implements SudokuBoard
{
public SudokuBoard_Text(SudokuGame sudokugame)
{
game = sudokugame;
}
public void close()
{
}
public void printDashes(int i)
{
printDashes(i, '-');
}
public void printDashes(int i, char c)
{
for(int j = 0; j < 3; j++)
System.out.printf(" ", new Object[0]);
for(int k = 3; k < i; k++)
System.out.print(c);
}
public void refresh()
{
int i = (int)(Math.log10(game.getSize()) + 1.0D);
int j = 5 + (i + 5) * game.getSize() + game.getSectionSize();
String s = (new StringBuilder()).append(" %c%").append(i).append("d%c |").toString();
String s1 = (new StringBuilder()).append(" %").append(i).append("s |").toString();
System.out.println();
System.out.print(" ||");
for(int k = 0; k < game.getSize(); k++)
{
System.out.printf(s, new Object[] {
Character.valueOf(' '), Integer.valueOf(k + 1), Character.valueOf(' ')
});
if((k + 1) % game.getSectionSize() == 0)
System.out.printf("|", new Object[0]);
}
System.out.println();
printDashes(j, '=');
System.out.println();
for(int l = 0; l < game.getSize(); l++)
{
char c = (char)(65 + l);
System.out.printf(" %c ||", new Object[] {
Character.valueOf(c)
});
for(int i1 = 0; i1 < game.getSize(); i1++)
{
int j1 = game.getMatrix().get(l, i1);
if(j1 == 0)
{
System.out.printf(s1, new Object[] {
" "
});
} else
{
char c1 = ' ';
if(j1 < 0)
{
c1 = '*';
j1 *= -1;
}
System.out.printf(s, new Object[] {
Character.valueOf(c1), Integer.valueOf(j1), Character.valueOf(c1)
});
}
if((i1 + 1) % game.getSectionSize() == 0)
System.out.printf("|", new Object[0]);
}
System.out.println();
if((l + 1) % game.getSectionSize() == 0)
{
printDashes(j, '=');
System.out.println();
} else
{
printDashes(j);
System.out.println();
}
}
}
SudokuGame game;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -