if u've ever used a game shark chances are u've also used it on a game that has so many codes and code combos that you get lost in the list,and if not u should try making a custom unit in ogre battle 64 @_@ lol
but that aside the game shark uses hexadecimal based codes , so i'm trying to make a program that will make finding a certain code combo a lot easier ( for the above mentioned game ) .
as i was looking at the codes i realized their all organized very well , so well all i need to do is put in the character codes for player 1 , and then add n to the pre-existing hex address to get the code for that character slot. sounds easy , except for the fact that i cant find a hexadecimal class that can add and subtract integers from the hex code .
so now that u know exactly what i need and why , here's the code and my problem ...
i put in "0000000f"
that should give me the number 15 when i call this method
instead i get 150000000
help plz
strHex is the input for this
public int toInt(){ char[] list = strHex.toCharArray(); int[] places = new int[8]; int total = 0; for (int i = 0; i < 8;i++){ System.out.println("1st "+i); System.out.println(list[i]); System.out.println(15 * (Math.pow(10, i))); switch (list[i]){ case '0': places[i] = (int) (0 * Math.pow(10, i)); break; case '1': places[i] = (int) (1 * Math.pow(10, i)); break; case '2': places[i] = (int) (2 * Math.pow(10, i)); break; case '3': places[i] = (int) (3 * Math.pow(10, i)); break; case '4': places[i] = (int) (4 * Math.pow(10, i)); break; case '5': places[i] = (int) (5 * Math.pow(10, i)); break; case '6': places[i] = (int) (6 * Math.pow(10, i)); break; case '7': places[i] = (int) (7 * Math.pow(10, i)); break; case '8': places[i] = (int) (8 * Math.pow(10, i)); break; case '9': places[i] = (int) (9 * Math.pow(10, i)); break; case 'a': places[i] = (int) (10 * Math.pow(10, i)); break; case 'b': places[i] = (int) (11 * Math.pow(10, i)); break; case 'c': places[i] = (int) (12 * Math.pow(10, i)); break; case 'd': places[i] = (int) (13 * Math.pow(10, i)); break; case 'e': places[i] = (int) (14 * Math.pow(10, i)); break; case 'f': places[i] = (int) (15 * Math.pow(10, i)); break; } } for (int a = 7; a > -1;a--){ System.out.println(total); System.out.println(places[a]); total += places[a]; System.out.println("2nd "+a); } System.out.println(total); return total; }