SHARE
TWEET

Untitled

a guest Mar 26th, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $woorden = file_get_contents('input.txt');
  3. $woord = explode("\n", $woorden);
  4. $zelfden = array();
  5. foreach ($woord as $key => $value) {
  6.     $letter = str_split($value);
  7.     for ($i = 0; $i < count($letter) - 1; $i++) {
  8.         if ($letter[$i] == $letter[$i + 1]) {
  9.             $zelfde = array($i, $key, $letter[$i]);
  10.             array_push($zelfden, $zelfde);
  11.         }
  12.     }
  13. }
  14. foreach ($zelfden as $key => $value) {
  15.     $rij = array($value[0], $value[1] + 1, $value[2]);
  16.     if (array_search($rij, $zelfden) != false) {
  17.         echo ("horizontaal=" . $rij[0] . " verticaal=" . $rij[1] . " letter=" . $rij[2] . PHP_EOL);
  18.     }
  19. }
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