Solved How to make a number generator From 1-100

January 24, 2016 at 09:19:50
Specs: Windows 7
how do I make a number generator using batch to go from 1-100? I'm not sure how to do it and I need one for my batch file game I'm making I also need to know how to make it to where I can make the number generator something else EX: 1-5 EX:25-1000

See More: How to make a number generator From 1-100

Report •

January 24, 2016 at 15:36:35
Your looking to output numbers in series from 1 to 100?

for /l %m in (1, 1, 100) do echo %m

If you want random use the rand function.

set /a "rand=%nums% %% 101"


Report •

January 24, 2016 at 16:23:04
'Could you describe in more detail please?

Report •

January 24, 2016 at 20:15:29
✔ Best Answer
Hi Mike: I think he means like this:

::------- demo only - begin demo script
@echo off & setlocal
set range=%1
echo demo of random range, usage: %0 range
echo where range is upper-bound of random number, must be less than 32767
if not defined range goto :eof
set /a x=%random% "%%" %range%
set /a x+=1
echo x:%x%
set r=
set /p r=new range or repeat:
if not defined r goto :1
set /a r+=0
if %r% lss 2 goto :eof
set range=%r%
goto :1

message edited by nbrane

Report •
Related Solutions

Ask Question