$dll = DllOpen("user32.dll") $joueur1 = "Joueur n1" $joueur2 = "Joueur n2" $nombremaxi = "100" $nombremini = "1" $ok = 0 Global $s $compte = 0 Opt("SendKeyDelay",3) MsgBox(0 + 64,"Jeu du + ou -", "Bienvenue!!! clique sur OK pour continuer") SplashTextOn ( "", "Le jeu du Plus ou Moins... By Tim"&@crlf&"Initiallisation en cours... veuillez patienter."&@crlf&"Ne pas cliquer avec la souris pendant l'initialisation.",@DesktopWidth,@DesktopHeight,0,0,33) ShellExecute(@WindowsDir & "\system32\notepad.exe") WinWait("Sans titre - Bloc-notes") WinSetState("Sans titre - Bloc-notes", "", @SW_MAXIMIZE) WinSetTitle ( "Sans titre - Bloc-notes", "", "Le jeu du Plus ou Moins... By Tim" ) Send("Jeu du plus ou moins. By Tim . {Enter} Suivez attentivement les consignes.{Enter}{Enter}") Send("____________________________________________________________{Enter}_________________________Menu_______________________________{Enter}____________________________________________________________{Enter}") Send("Appuyez sur j pour Jouer {Enter}Appuyez sur p pour parametrer{Enter}Appuyez sur q pour quitter{Enter}") Send("____________________________________________________________{Enter}{Enter}{Enter} CHOIX ----------->>> ") Opt("SendKeyDelay",50) WinActivate("Le jeu du Plus ou Moins... By Tim") SplashOff() While 1 Hotkeyset("j","jouer") Hotkeyset("p","configurer") Hotkeyset("q","quitter") Sleep(100) WEnd Func jouer() $ok = 0 Hotkeyset("j") Hotkeyset("p") Hotkeyset("q") $nbatrouver = random(1,$nombremaxi,1) $nb = random(1,2,1) If $nb = 1 then $tourjoueur = $joueur1 If $nb = 2 then $tourjoueur = $joueur2 Send(" {Enter} A "&$tourjoueur & " de commencer.{Enter}") Sleep ( 1000 ) While $ok <> 1 $nombrepense = InputBox ( "Jeu du plus ou moins. By Tim . ", "Veuillez rentrer un nombre entre "&$nombremini&" et "&$nombremaxi , "" ) $compte = $compte + 1 If $nombrepense = $nbatrouver then $grade = _grade($compte) send(" Bravo{Enter}"&$tourjoueur&" a gagné en "&$compte&" coups. {Enter} GRADE = "&$grade ) $ok = 1 Exit ElseIf $nombrepense > $nbatrouver then send(" Nombre tenté: "&$nombrepense&" Le nombre recherché est plus petit{Enter}") $nombremaxi = $nombrepense Else send(" Nombre tenté: "&$nombrepense&" Le nombre recherché est plus grand{Enter}") $nombremini = $nombrepense EndIf If $tourjoueur = $joueur1 then $tourjoueur = $joueur2 Else $tourjoueur = $joueur1 EndIf Send(" A "&$tourjoueur & " de jouer.{Enter}") WEnd EndFunc Func configurer() $joueur1 = InputBox ( "Jeu du plus ou moins. By Tim . ", "Veuillez rentrer le nom du joueur n1" , "Joueur n1" ) $joueur2 = InputBox ( "Jeu du plus ou moins. By Tim . ", "Veuillez rentrer le nom du joueur n2" , "Joueur n2" ) $nombremaxi = InputBox ( "Jeu du plus ou moins. By Tim . ", "Veuillez rentrer le maximum autorisé pour le nombre aléatoire" , "100" ) EndFunc Func quitter();Pour quitter, mais honnetement, qui aurait envi de quitter un jeu aussi bien? DllClose($dll) $ping = WinGetProcess("Le jeu du Plus ou Moins... By Tim") ProcessClose($ping) Exit EndFunc Func _grade($s) If Isnumber($s) <> 1 or $s <= 0 then return "Trouffion de Base qui pue la merde et qui a éssayé de tricher" If $s = 1 then return " Maréchal ******* " If $s = 2 then return " Genéral ***** " If $s = 3 then return " Genéral **** " If $s = 4 then return " Genéral *** " If $s = 5 then return " Genéral ** " If $s = 6 then return " Colonel " If $s = 7 then return " Lieutenant-Colonel " If $s = 8 then return " Capitaine " If $s = 9 then return " Lieutenant " If $s = 10 then return " Sous-Lieutenant " If $s = 11 then return " Aspirant " If $s = 12 then return " Major " If $s = 13 then return " Adjudant-Chef " If $s = 14 then return " Adjudant " If $s = 15 then return " Sergent-Chef " If $s = 16 then return " Sergent " If $s = 17 then return " Caporal-Chef " If $s = 18 then return " Caporal " If $s = 19 then return " Soldat ** " If $s = 20 then return " Soldat * " If $s > 20 then return " Recrue " EndFunc