import java.io. *;import java.util.ArrayList;import static java.lang.Math.*;import static org.javascool.macros.Macros.*;import static org.javascool.macros.Stdin.*;import static org.javascool.macros.Stdout.*;import static org.javascool.proglets.algoDeMaths.Functions.*;public class JvsToJavaTranslated48 implements Runnable{ private static final long serialVersionUID = 48L; public void run() { try{ main(); } catch(Throwable e) { if (e.toString().matches(".*Interrupted.*"))println("\n-------------------\nProgramme arrêté !\n-------------------\n"); else println("\n-------------------\nErreur lors de l'exécution de la proglet\n"+org.javascool.core.Jvs2Java.report(e)+"\n-------------------\n");} }public static void main(String[] usage) { new org.javascool.widgets.MainFrame().reset("+++++++", 700, 600, org.javascool.core.ProgletEngine.getInstance().setProglet("algoDeMaths").getProgletPane()).setRunnable(new JvsToJavaTranslated48());} //import java.io. *; //import java.util.ArrayList; static ArrayList texte_sortie = new ArrayList(); static String retour_ligne = System.getProperty("line.separator"); static char[] Tab_conversion_int_a_char_crypte = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' '} ; static char lettre; void main() { recuperer_info(); rendre_char_crypte(); println("Effectué\n"); } static void recuperer_info() { try{ BufferedReader fichier_entree = new BufferedReader(new FileReader("D:/A_crypter.txt")); String ligne; int char_crypte; int length_lignes_passees =0; int numero_ligne =0; int chiffre = readInt(); while ((ligne = fichier_entree.readLine()) != null) { sleep(1); int position_char_dans_ligne = 0; for (char_crypte = (texte_sortie.size()); char_crypte < (ligne.length() + length_lignes_passees + numero_ligne); char_crypte++) { lettre = ligne.charAt(position_char_dans_ligne); crypter_char(chiffre, lettre); position_char_dans_ligne++; } length_lignes_passees = length_lignes_passees + ligne.length(); numero_ligne = numero_ligne+1; texte_sortie.add(retour_ligne); } fichier_entree.close(); } catch(Exception e) { } } // texte_sortie.add(Tab_conversion_int_a_char_crypte[lettre]); static void crypter_char(int chiffre, char lettre) { if (lettre == ' ') { lettre = (char) ((32 + chiffre - 6) % 27); } else { lettre = (char) ((lettre + chiffre - 65) % 27); } texte_sortie.add(Tab_conversion_int_a_char_crypte[lettre]); } static void rendre_char_crypte() { try{ PrintWriter fichier_sortie = new PrintWriter(new FileWriter("D:/Fichier_crypté.txt", false)); for (int valeur_variable_rendue = 0; valeur_variable_rendue < texte_sortie.size(); valeur_variable_rendue++) { fichier_sortie.print(texte_sortie.get(valeur_variable_rendue)); } fichier_sortie.close(); } catch(Exception e) { } } }