@jreaux => Chapeau! Total respect :hola:
Mais il faudrait faire le modulo sur 12 ...
Code:
1
2
3
4
5
6
7
8
9
10
11
12 html=""; for( var i = 1; i <= 100; i++ ) { temp="pi"; switch( true ){ case ( i % 12 == 0 ) : temp="po"; case ( i % 4 == 0 ) : html+="cha"+temp; temp="pi"; break; default: html+=i } html+=' ';
Qui peut se "simplifier" en
ou plus confusCode:
1
2
3
4
5 html=""; var i=0; while( ++i <= 100){ html+= ( ( i%4 == 0 ) ? "chap"+ ( (i%12 == 0)?"o":"i" ) : i ) +" "; }
Code:
1
2
3
4
5
6 html=""; var i=0; t="oii"; while(++i <= 100){ html+= ( i%4 ? "chap"+ t.charAt((i%12)%3): i ) +" "; }