Last active
October 22, 2019 08:54
-
-
Save chezsick/281f2d6f2a1725a73815d6b364a20d16 to your computer and use it in GitHub Desktop.
Recreate A Lotto Like Rapido From Francaise Des Jeux With PipeGlade ;;;;;;;; cmd ::::::: php tirage.php < /dev/urandom | pipeglade tirage.ui
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Debug De Config | |
| $nbballdef = 30; | |
| $tiragedef = 5; | |
| $time = 150; | |
| // Fin De Config | |
| $numero = 1; | |
| while (false !== ($o = fread(STDIN,$tiragedef))) | |
| { | |
| echo "numero set_text \"N" . $numero ."\"\n"; | |
| for ($e = 0;$e < $time;$e++) | |
| { | |
| $p = 1-($e/floatval($time)); | |
| $p = str_replace(".",",",strval($p)); | |
| echo "time set_fraction \"". $p . "\"\n"; | |
| echo "time set_text \"" . strval($time - $e) ."\"\n"; | |
| sleep(1); | |
| } | |
| echo "tirage set_text \""; | |
| $nbball = $nbballdef; | |
| $balls = range(1,$nbballdef); | |
| for ($g = 0;$g < $tiragedef;$g++) | |
| { | |
| $tired = intval($nbball*(ord($o[$g])/256)); | |
| echo $balls[$tired]." "; | |
| array_splice($balls,$tired,1); | |
| $nbball = $nbball - 1; | |
| } | |
| echo "\"\n"; | |
| for ($e = 0;$e < $time;$e++) | |
| { | |
| $p = $e/floatval($time); | |
| $p = str_replace(".",",",strval($p)); | |
| echo "time set_fraction \"". $p . "\"\n"; | |
| echo "time set_text \"" . strval($e) ."\"\n"; | |
| sleep(0.02); | |
| } | |
| $numero = $numero +1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!-- Generated with glade 3.22.1 --> | |
| <interface> | |
| <requires lib="gtk+" version="3.20"/> | |
| <object class="GtkWindow" id="window"> | |
| <property name="can_focus">False</property> | |
| <property name="title" translatable="yes">Loto</property> | |
| <property name="modal">True</property> | |
| <child> | |
| <placeholder/> | |
| </child> | |
| <child> | |
| <object class="GtkGrid"> | |
| <property name="visible">True</property> | |
| <property name="can_focus">False</property> | |
| <child> | |
| <object class="GtkProgressBar" id="time"> | |
| <property name="visible">True</property> | |
| <property name="can_focus">False</property> | |
| <property name="show_text">True</property> | |
| </object> | |
| <packing> | |
| <property name="left_attach">0</property> | |
| <property name="top_attach">2</property> | |
| </packing> | |
| </child> | |
| <child> | |
| <object class="GtkLabel" id="tirage"> | |
| <property name="visible">True</property> | |
| <property name="can_focus">False</property> | |
| <property name="label" translatable="yes">? ? ? ? ?</property> | |
| </object> | |
| <packing> | |
| <property name="left_attach">0</property> | |
| <property name="top_attach">0</property> | |
| </packing> | |
| </child> | |
| <child> | |
| <object class="GtkLabel" id="numero"> | |
| <property name="visible">True</property> | |
| <property name="can_focus">False</property> | |
| <property name="label" translatable="yes">N1</property> | |
| </object> | |
| <packing> | |
| <property name="left_attach">0</property> | |
| <property name="top_attach">1</property> | |
| </packing> | |
| </child> | |
| </object> | |
| </child> | |
| </object> | |
| </interface> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment