Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Name: gimmpy225
K, im currently learning java and I wanted to make a program that is short and prints all the unicode symbols out in the cmd prompt (preferably on the same line).
One way I was attempting to acheive this was with 2 for loops working together, 1 to iterate through an array of 9999 strings and 1 to put each unicode number in each of the cells of the array.
I just cant figure out how to do this..... would i really need 2 for loops?
Im writing this in Java.not sure if I provided you with enough info on what im attempting to do so ill try to sum it up, Any way to print every unicode symbol to the screen.
GIMPS

Well, if I understand what you want, I think you should be able to do this with one for loop.
I'll leave you to figure that out.
Have you looked at all the infomation at:
http://www.unicode.org
?????There is some Java specific stuff there.
Hope this gives you some ideas .......
Guy

well i thought 1 would work, but i cant figure out how to get it to iterate from 0001 to 9999
i mean how do i make it go from 0001 to 0009 then 0010 to 0099 then 0999 to 1000?
cause i can get 1000-9999 no problem, its those first ones i have no idea how to get, I guess if i used 4 for loops?
but even then I dont think java let me do
for(i=1;i<=9;i++)
{
a[--i]="\u000"i;
}without having a fit about it lol.
ofcourse erlier in the code there was String[] a = new String[9998]
GIMPS

Well, my first cut would be:
char[] uc = new char[1000];
for (int i = 0;i < 1000;i++)
{
uc[i] = (char)i;
}You should also take a look at this sample code:
http://sunsite.tus.ac.jp/java/JDK1.1/docs/guide/awt/demos/symboltest/
Guy

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |