Created
September 18, 2012 14:28
-
-
Save billowdood/3743430 to your computer and use it in GitHub Desktop.
Creacion de Regla
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void generacionReglaBinario(){ | |
int i,j = 7,valorTemporalRegla = numeroRegla; | |
//Temporal array | |
int[] arrayTemporal = new int[8]; | |
//pasar el numero de regla a binario | |
for(i = 0; i < 8; i++){ | |
arrayTemporal[i] = valorTemporalRegla % 2; | |
valorTemporalRegla = valorTemporalRegla / 2; | |
} | |
//Acomodar el numero binario | |
i = 0; | |
do{ | |
reglaBinario[i] = arrayTemporal[j]; | |
i++; | |
j--; | |
}while( j >= 0); | |
} | |
public void generacionHashMapRegla(){ | |
//Crear el hashmap con la regla | |
int i,j = 7; | |
for(i = 0;i < 8;i++){ | |
valoresRegla.put(i,reglaBinario[j]); | |
j--; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment