Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

spot

a guest Aug 10th, 2018 52 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1.     $alphabet = "abcd"; // ton alphabet
  2.     $N = 6;             // longueur des chaines à générer
  3.    
  4.     $alphabet_array = str_split ($alphabet, 1); // tableau de lettres de l'alphabet
  5.     $alphabet_length = strlen ($alphabet);      // nb de lettres de l'alphabet
  6.     $S = array();
  7.  
  8.    
  9.     function IteraFn ($I) {
  10.         global $alphabet_length, $alphabet_array, $S, $N; // variables globales
  11.         for ($j = 0; $j < $alphabet_length; $j++) {
  12.             $S[$I] = $alphabet_array[$j];
  13.             If ($I == $N-1) {
  14.                 echo implode($S)."<br>";        // echo des strings
  15.             }
  16.             Else {
  17.                 IteraFn ($I+1);
  18.             }
  19.         }
  20.     }
  21.    
  22.     IteraFn(0);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top