d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Unicode Question
Add Reply New Topic New Poll
Member
Posts: 2,142
Joined: Mar 31 2007
Gold: 0.00
Feb 17 2022 01:39pm
i have a simple code that prints a 10x10 grid
im trying to use unicode to change the grid from showing a "." for each tile on the grid

public class Array{
public static void main( String[] args ) {
//Setup Game Data
int colSize = 10;
int rowSize = 10;
String floorTile = ". ";

//Game Loop
//Draw Game Scene
for(int y=0; y < rowSize; y++){ //start outer for-loop (rows)
for(int x=0; x < colSize; x++){ //start inner for-loop (columns)
System.out.print(floorTile); //draw floor tile
} //end inner for-loop (x-axis)
System.out.print("\n"); //new line for next row
}
//Get Player Input
//Execute Player Action
//Check Win Condition
//Execute Monster Action
//Check Lose Condition
}
}

when i change String floorTile = ". "; to use a unicode character all it prints out in a "?" for the tile now

is there a way to import unicodes so are displayed when printing?

I am usint Notepad++ for code and gitbash for compiling and running

any advise on what im doing wrong or what i can change to have the unicode displayed?
Member
Posts: 380
Joined: Sep 24 2021
Gold: 0.00
Mar 2 2022 09:37pm
Member
Posts: 2,837
Joined: Dec 15 2021
Gold: 4,795.00
Mar 23 2022 02:34pm
\u1234

Where 1234 is the Unicode number. Thank me in fg.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll