🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.os.msdos
Article #79

Re: un generateur de nombre aleatoire sous DOS

#79
From: Brat'ac
Date: Thu, 21 Jul 2005 12:05
42 lines
3271 bytes
S�bastien WILLEMIJNS a couch� sur son �cran :
> hello,
>
> je recherche un programme DOS en ligne de comande qui donne un nombre
> (si possible) entier au pif entre X et Y style 
>
> C:\>number 16 32
> 18

Bonjour
Dans une fen�tre de commandes ( cmd de XP ou W2K mais pas sous win9X)
le batch suivant permet de trouver un nombre al�atoire entre deux bornes
Le seul probl�me c'est que plus l'�cart entre les deux nombres est r�duit plus c'est
long voir tr�s long si �cart r�duit au max.
�a doit �tre am�liorable.


--------------------- copie on --------------------------
@echo off
set ale=
IF (%1)==() GOTO USAGE
IF (%2)==() GOTO USAGE
:: ------------------------
:debut
set /A ale=%random%
if  /I %2 LEQ %ale% goto debut
if  /I %1 GEQ %ale% goto debut
goto FIN
:USAGE
echo Entrez deux valeurs de 0 a 32767 separ�es par un espace
echo le premier doit etre inferieur au deuxieme
echo EX: nom-du-batch 45 245
:FIN
echo La valeur final du nombre est : %ale%
--------------------------- copie off ------------------
GS



-- 
Ceci est une signature automatique de MesNews.
Site : http://mesnews.no-ip.com
Technical Details
Message-ID: <mn.ab4d7d579f6e4da9.9286@laporte.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!infeed-1.proxad.net!news16-e.free.fr!not-for-mail
References: <dbmgem$2378$1@talisker.lacave.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10f688,1b9cd5f314610f29
X-Google-Thread: f9822,1b9cd5f314610f29
X-Google-Attributes: gid10f688,gidf9822,public
X-Google-Language: FRENCH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!infeed-1.proxad.net!news16-e.free.fr!not-for-mail
Subject: Re: un generateur de nombre aleatoire sous DOS
From: "Brat'ac" <Bratac@laporte.net>
References: <dbmgem$2378$1@talisker.lacave.net>
Newsgroups: fr.comp.os.msdos,fr.comp.lang.c
Message-ID: <mn.ab4d7d579f6e4da9.9286@laporte.net>
Followup-To: fr.comp.os.msdos
Organization: La porte
X-Newsreader: MesNews/1.04.00.00
Date: Thu, 21 Jul 2005 14:05:20 +0200
MIME-Version: 1.0
Reply-To: Bratac@laporte.net
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEUUEiSciIqLXmXGxr3Tl
 ZNgU0/8/flJIi0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+XjvWAAAACXBIWXMAAA7DAAAOwwHHb6h
 kAAACVklEQVR4nFWTPXPbMAyGNTTtDFp0ZuKEeM7JzS6VbdaSNqofYNed7UbHv9+XH86lOEuy8AgvI
 ADqLh/smYj6l/q/++CfHQC5sYL+v+eLFdLptvlPxVVoVuvENdFnhtJmHIGyShf1UMjJvk2G2UmYiKD
 Ssegmg69h63/gejZaQjpVDRmoz7bHMV8pvFQArT8H78/l5/1rMNsC1F0uj3v/tL+c96dMrrQpAFlOn
 7yfTt/GcZwAHolrhIbfA+435/FyPiLJfLMNRNsD2HbMXu22Ao0Tyh52a6nNHF/lVwGRo9d1UXazRhB
 n46Em14NVTXqcNaV18Gw1gwh2lGVJC4DqGicyBWTrNYNh1iWtUDQaGiCNTpB5gRRS2ndghFXZe2bWd
 Bu+r9cKymsUs5E1Dkb/1nLN/g4mGfyMsM8V0D2C82kg24Be72Au1Bl5a03ErcA9VBKNtKpcD5GEzvS
 SxYRXbcl7OWaQ0hFRg72DYPk2eUGj0uDVsWHlGjELMzlBDOcXZd7FJuWMA7ixY5EkUaSCMDtFiwTtI
 xMFcTYD0cPMaXmQ2jZhwUZKGVQwNiEkG7prRMTZAmKUFCDPGS1QErJtS3bqXI8S4MPouUZgtDE/Bnc
 FuFVpERGFht5PHM2C2S6ibYLBYZ0ccQQo23EHAjAxRzZuqeXdIwJmOPWGJqN1oRrQQACYCJG8A8oAz
 Sgjn+g9Io4l2vUDvr3ecJPo1BnMPiqXb9/YWlMGhI4Gk7PAWOqSA0SSSKTLl5ymNbiAQFgJesxbztw
 AJqOdwc4/CP18SMW3lgbh9A+n7iuT5HieCQAAAABJRU5ErkJggg==
Content-Type: text/plain; charset="iso-8859-15"; format=flowed
Content-Transfer-Encoding: 8bit
X-Antivirus: avast! (VPS 0529-1, 20/07/2005), Outbound message
X-Antivirus-Status: Not-Tested
Lines: 44
NNTP-Posting-Date: 21 Jul 2005 14:05:23 MEST
NNTP-Posting-Host: 81.250.197.59
X-Trace: 1121947523 news16-e.free.fr 6886 81.250.197.59:4432
X-Complaints-To: abuse@proxad.net