[AutoIt] Calcul Mental.
Game Maker forum :: Les jeux/La programmation :: Vos autres jeux que ceux Game Maker :: La programmation en général
Page 1 sur 1
[AutoIt] Calcul Mental.
Salut
Voici un programme qui affiche des calcules aléatoires sujet A et B.
Exécutable: http://www.sendspace.com/file/kvfsim
C'est une version de test, pas de menu, le programme tourne en boucle et les calculs s'actualisent toute les 10 secondes.
ECHAP pour fermer le programme.
Dylan.
PS: Je tiens à signaler que la balise code bug
Voici un programme qui affiche des calcules aléatoires sujet A et B.
- Code Source:
- Code:
#include <GUIConstants.au3>[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
#include <GUIConstantsEx.au3>[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
#include <ButtonConstants.au3>[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
#include <WindowsConstants.au3>[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
HotKeySet("{ESC}", Close)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Form1 = GUICreate("Calcul Mental - Par Dylan Gadacha", 720, 320)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUISetState(@SW_SHOW)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Blue = GUICtrlCreateLabel("", 0, 0, 360, 320)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlSetBkColor(-1, "0x6699FF")[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Pink = GUICtrlCreateLabel("", 360, 0, 360, 320)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlSetBkColor(-1, "0xCC33CC")[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Sleep = 10[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
While 1[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$nMsg = GUIGetMsg()[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
Switch $nMsg[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
Case $GUI_EVENT_CLOSE[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
Exit[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
EndSwitch[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Cl1_Nb1 = Round(Random(1, 10), 0)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Cl1_Nb2 = Round(Random(1, 10), 0)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
Local $DOpp1;[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Opp1 = Round(Random(0, 400), 0)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
If $Opp1 > "0" And $Opp1 < "100" Then $Draw_Opp1 = "+"[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
If $Opp1 > "100" And $Opp1 < "200" Then $Draw_Opp1 = "-"[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
If $Opp1 > "200" And $Opp1 < "300" Then $Draw_Opp1 = "x"[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
If $Opp1 > "300" And $Opp1 < "400" Then $Draw_Opp1 = "/"[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Draw_Cl1 = GUICtrlCreateLabel("" & $Cl1_Nb1 & "" & $Draw_Opp1 & "" & $Cl1_Nb2, 0, 100, 350, 110, $SS_CENTER)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlSetColor(-1, "0x0066FF")[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlSetBkColor(-1, "0x6699FF")[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlSetFont(-1, 72, 0, 0, "Arial Rounded MT Bold")[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Cl2_Nb1 = Round(Random(1, 10), 0)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Cl2_Nb2 = Round(Random(1, 10), 0)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Opp2 = Round(Random(0, 400), 0)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
If $Opp2 > "0" And $Opp2 < "100" Then $Draw_Opp2 = "+"[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
If $Opp2 > "100" And $Opp2 < "200" Then $Draw_Opp2 = "-"[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
If $Opp2 > "200" And $Opp2 < "300" Then $Draw_Opp2 = "x"[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
If $Opp2 > "300" And $Opp2 < "400" Then $Draw_Opp2 = "/"[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Draw_Cl2 = GUICtrlCreateLabel("" & $Cl2_Nb1 & "" & $Draw_Opp2 & "" & $Cl2_Nb2, 370, 100, 350, 110, $SS_CENTER)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlSetColor(-1, "0x990066")[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlSetBkColor(-1, "0xCC33CC")[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlSetFont(-1, 72, 0, 0, "Arial Rounded MT Bold")[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Time = 200[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Current_Time = 0[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Draw_CurrentTime = GUICtrlCreateLabel("", 720/2-10, 320/2-100, 20, $Current_Time)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Draw_Time = GUICtrlCreateLabel("", 720/2-12, 320/2-102, 24, $Time+4, $SS_SUNKEN)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlSetBkColor(-1, "0x660066")[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
While $Current_Time < 200[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$nMsg = GUIGetMsg()[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
Switch $nMsg[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
Case $GUI_EVENT_CLOSE[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
Exit[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
EndSwitch[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
Sleep(1000)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Current_Time+=200/$Sleep[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlDelete($Draw_CurrentTime)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
$Draw_CurrentTime = GUICtrlCreateLabel("", 720/2-10, 320/2-100, 20, $Current_Time)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
WEnd[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlDelete($Draw_Cl1)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlDelete($Draw_Cl2)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
GUICtrlDelete($Draw_Time)[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
WEnd[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
Func Close()[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
Exit[color=#2e8b57][font=Courier, CourierNew, sans-serif][/font][/color]
EndFunc
Exécutable: http://www.sendspace.com/file/kvfsim
C'est une version de test, pas de menu, le programme tourne en boucle et les calculs s'actualisent toute les 10 secondes.
ECHAP pour fermer le programme.
Dylan.
PS: Je tiens à signaler que la balise code bug
Sujets similaires
» [AutoIt]Screenshot Quickly - Réaliser des vidéos avec des captures d'écran !
» [AutoIt] Mr. Square
» [AutoIt] TRON (2 Joueurs)
» [AutoIt] Avoid - Un jeu très difficile !
» [AutoIt] Calculatrice à virgule flottante.
» [AutoIt] Mr. Square
» [AutoIt] TRON (2 Joueurs)
» [AutoIt] Avoid - Un jeu très difficile !
» [AutoIt] Calculatrice à virgule flottante.
Game Maker forum :: Les jeux/La programmation :: Vos autres jeux que ceux Game Maker :: La programmation en général
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|