~zodiacsohma/armagetronad/random_arma_colors

« back to all changes in this revision

Viewing changes to Random Arma Colors.php

  • Committer: zodiacsohma1 at gmail
  • Date: 2013-02-06 01:17:00 UTC
  • Revision ID: zodiacsohma1@gmail.com-20130206011700-17r5h81ectxt06sd
Storing values in array and calling them by their key.

Show diffs side-by-side

added added

removed removed

Lines of Context:
186
186
 
187
187
function getRandomColors()
188
188
{
 
189
    $arColors = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
189
190
        $colors = '';
190
 
        for($i=0; $i < 6; $i++)
 
191
        for($i = 0; $i < 6; $i++)
191
192
        {
192
193
                $cGot = rand(0, 15);
193
 
                if ($cGot > 9)
 
194
                /*if ($cGot > 9)
194
195
                {
195
196
                        if ($cGot == 10)                $cGot = "a";
196
197
                        elseif ($cGot == 11)    $cGot = "b";
198
199
                        elseif ($cGot == 13)    $cGot = "d";
199
200
                        elseif ($cGot == 14)    $cGot = "e";
200
201
                        elseif ($cGot == 15)    $cGot = "f";
201
 
                }
202
 
                $colors .= $cGot;
 
202
                }*/
 
203
        
 
204
                $colors .= $arColors[$cGot];
203
205
        }
204
206
        return $colors;
205
207
}