Code:
</style>
<script type="text/javascript">
<!--
var magicsymbol = 0;
var commonsymbol = 0;
var innertext = '';
var symbols = new Array('A','C','D','F','G','H','J','K','M','P','R','S','T','W','X','Z','#','^','_','[',']','{','}','§','©','®','€','£','¥','æ','Ø','¶','Œ','ß');
function makeSymbolTable() {
magicsymbol = Math.round(Math.random()*33);
innertext = '<table id="symboltable" style="width: 575px; margin: 0 auto; border: 0;">';
for (var i = 0; i < 100; i++) {
if ((i + 1)%10 == 1) {
innertext += '<tr>';
}
commonsymbol = Math.round(Math.random()*33);
if (i%9 == 0 && i < 89) {
commonsymbol = magicsymbol;
}
innertext += '<td> '+i+'</td><td class="symbol">'+symbols[commonsymbol]+' </td>';
if ((i + 1)%10 == 0) {
innertext += '</tr>';
}
}
innertext += '</table>';
document.getElementById('symboltablecontener').innerHTML = innertext;
document.getElementById('button').innerHTML = '';
}
function showAnswer() {
document.getElementById('button').innerHTML = symbols[magicsymbol];
document.getElementById('symboltablecontener').innerHTML = '<a href="#" onclick="javascript:makeSymbolTable(); return(false);" style="font-family: Arial, sans-serif; font-weight: bold; color: #C63;">Réessayer</a>';
}
-->
</script>
Voici le Code (javascript) permettant ce tour de passe passe ... il est contenu dans le code source de cette page
C'est le premier truc que j'ai été voir ...
En gros le principe c'est que quelque soit le chiffre que tu choisisse, si tu fait l'operation de soustraction qu'ils te dicte, tu tombera forcement sur un chiffre multiple de 9. Et tu aura remarqué que chaque chiffre multiple de 9 ont toujours le même caractère assignés ...