1.

Solve : choose random varible?

Answer»

ive been trying to get a madlib program to put a random mad lib up. this the expirmental code i have so far
Code: [Select]@echo off
set random = 1
if '%choice%'=='1' GOTO hello
if '%choice%'=='1' goto hey
:hello
echo hello
pause
exit
:hey
echo hey
pause
exitYou probably want something like
Code: [Select]@echo off
setlocal

set /a rnd=%random%%%3

if %rnd% EQU 0 set verb=walk
if %rnd% equ 1 set verb=run
if %rnd% equ 2 set verb=swim

echo Verb = %verb%the only PROBLEM is it goes down the list in order each time you open it but this'll WORK



Discussion

No Comment Found