comprobarhorizontal

    0

    0

    izian db

    a

    Shortcut: comprobarhorizontal

    $i = 0;
    $vermell = 0;
    $groc = 0;
    while ($vermell < 4 && $groc < 4 && $i <= count($_SESSION["tauler"][0]) - 1) {
    
      if ($_SESSION["tauler"][$fila][$i] == 1) {
        $vermell++;
        $groc = 0;
      } elseif ($_SESSION["tauler"][$fila][$i] == 2) {
        $groc++;
        $vermell = 0;
      } else {
        $vermell = 0;
        $groc = 0;
      }
      $i++;
    }
    
    
    if ($vermell == 4 || $groc == 4) {
      return true;
    } else {
      return false;
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.