Java 8, 280(削除) 280 (削除ここまで) 274 bytes
-6 bytes thanks to @ceilingcat.
interface M{ // Class
static void main(String[]a){ // Mandatory main-method
String x="", // String for row 1, starting empty
y=x, // String for row 2, starting empty
z=x; // String for row 3, starting empty
for(int c:a[0].getBytes()){ // Loop over the bytes of the input
c-=48; // Convert the byte to integer
x+= // Append to row 1:
" " // a space
+(c==4|c==1? // +IfIf the digit is a 1 or 4:
" " " // Append athree spacespaces
: // Else:
"_")" _ "; // Append an underscore
+" "; // a space + underscore + another space instead
y+= // Append to row 2:
(c==7|c>0&c<4? // If the digit is 1, 2, 3, or 7:
" " // Append a space
: // Else:
"|") // Append a pipe
+(c==7|c<2? // +If the digit is 0, 1, or 7:
" " // Append a space
: // Else:
"_") // Append an underscore
+(c>4&c<7? // +If the digit is 5 or 6:
" " // Append a space
: // Else:
"|"); // Append a pipe
z+= // Append to row 3:
(c%2<1&c!=4? // If the digit is 0, 2, 6 or 8:
"|" // Append a pipe
: // Else:
" ") // Append a space
+(c%3==1? // +If the digit is 1, 4, or 7:
" " // Append a space
: // Else:
"_") // Append a pipe
+(c==2? // +If the digit is 2:
" " // Append a space
: // Else:
"|"); // Append a pipe
} // End of loop
System.out.print(x+"\n"+y+"\n"+z);
// Print the three rows
} // End of main-method
} // End of class
Java 8, 280 bytes
interface M{ // Class
static void main(String[]a){ // Mandatory main-method
String x="", // String for row 1, starting empty
y=x, // String for row 2, starting empty
z=x; // String for row 3, starting empty
for(int c:a[0].getBytes()){ // Loop over the bytes of the input
c-=48; // Convert the byte to integer
x+= // Append to row 1:
" " // a space
+(c==4|c==1? // +If the digit is a 1 or 4:
" " // Append a space
: // Else:
"_") // Append an underscore
+" "; // + another space
y+= // Append to row 2:
(c==7|c>0&c<4? // If the digit is 1, 2, 3, or 7:
" " // Append a space
: // Else:
"|") // Append a pipe
+(c==7|c<2? // +If the digit is 0, 1, or 7:
" " // Append a space
: // Else:
"_") // Append an underscore
+(c>4&c<7? // +If the digit is 5 or 6:
" " // Append a space
: // Else:
"|"); // Append a pipe
z+= // Append to row 3:
(c%2<1&c!=4? // If the digit is 0, 2, 6 or 8:
"|" // Append a pipe
: // Else:
" ") // Append a space
+(c%3==1? // +If the digit is 1, 4, or 7:
" " // Append a space
: // Else:
"_") // Append a pipe
+(c==2? // +If the digit is 2:
" " // Append a space
: // Else:
"|"); // Append a pipe
} // End of loop
System.out.print(x+"\n"+y+"\n"+z);
// Print the three rows
} // End of main-method
} // End of class
As function this would be 218 bytes instead.
Java 8, (削除) 280 (削除ここまで) 274 bytes
-6 bytes thanks to @ceilingcat.
interface M{ // Class
static void main(String[]a){ // Mandatory main-method
String x="", // String for row 1, starting empty
y=x, // String for row 2, starting empty
z=x; // String for row 3, starting empty
for(int c:a[0].getBytes()){ // Loop over the bytes of the input
c-=48; // Convert the byte to integer
x+= // Append to row 1:
c==4|c==1? // If the digit is a 1 or 4:
" " // Append three spaces
: // Else:
" _ "; // Append a space + underscore + space instead
y+= // Append to row 2:
(c==7|c>0&c<4? // If the digit is 1, 2, 3, or 7:
" " // Append a space
: // Else:
"|") // Append a pipe
+(c==7|c<2? // +If the digit is 0, 1, or 7:
" " // Append a space
: // Else:
"_") // Append an underscore
+(c>4&c<7? // +If the digit is 5 or 6:
" " // Append a space
: // Else:
"|"); // Append a pipe
z+= // Append to row 3:
(c%2<1&c!=4? // If the digit is 0, 2, 6 or 8:
"|" // Append a pipe
: // Else:
" ") // Append a space
+(c%3==1? // +If the digit is 1, 4, or 7:
" " // Append a space
: // Else:
"_") // Append a pipe
+(c==2? // +If the digit is 2:
" " // Append a space
: // Else:
"|"); // Append a pipe
} // End of loop
System.out.print(x+"\n"+y+"\n"+z);
// Print the three rows
} // End of main-method
} // End of class
As function this would be 212 bytes instead.
#Java 8, 280 bytes
Java 8, 280 bytes
#Java 8, 280 bytes
Java 8, 280 bytes
#Java 8, 280 bytes
interface M{static void main(String[]a){String x="",y=x,z=x;for(int c:a[0].getBytes()){c-=48;x+=" "+(c==4|c==1?" ":"_")+" ";y+=(c==7|c>0&c<4?" ":"|")+(c==7|c<2?" ":"_")+(c>4&c<7?" ":"|");z+=(c%2<1&c!=4?"|":" ")+(c%3==1?" ":"_")+(c==2?" ":"|");}System.out.print(x+"\n"+y+"\n"+z);}}
Explanation:
interface M{ // Class
static void main(String[]a){ // Mandatory main-method
String x="", // String for row 1, starting empty
y=x, // String for row 2, starting empty
z=x; // String for row 3, starting empty
for(int c:a[0].getBytes()){ // Loop over the bytes of the input
c-=48; // Convert the byte to integer
x+= // Append to row 1:
" " // a space
+(c==4|c==1? // +If the digit is a 1 or 4:
" " // Append a space
: // Else:
"_") // Append an underscore
+" "; // + another space
y+= // Append to row 2:
(c==7|c>0&c<4? // If the digit is 1, 2, 3, or 7:
" " // Append a space
: // Else:
"|") // Append a pipe
+(c==7|c<2? // +If the digit is 0, 1, or 7:
" " // Append a space
: // Else:
"_") // Append an underscore
+(c>4&c<7? // +If the digit is 5 or 6:
" " // Append a space
: // Else:
"|"); // Append a pipe
z+= // Append to row 3:
(c%2<1&c!=4? // If the digit is 0, 2, 6 or 8:
"|" // Append a pipe
: // Else:
" ") // Append a space
+(c%3==1? // +If the digit is 1, 4, or 7:
" " // Append a space
: // Else:
"_") // Append a pipe
+(c==2? // +If the digit is 2:
" " // Append a space
: // Else:
"|"); // Append a pipe
} // End of loop
System.out.print(x+"\n"+y+"\n"+z);
// Print the three rows
} // End of main-method
} // End of class
As function this would be 218 bytes instead.