Don't like ads? PRO users don't see any ads ;-)
Guest

Counting, comparing

By: hugsim on May 9th, 2012  |  syntax: DOS  |  size: 0.20 KB  |  hits: 33  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. @echo off
  2. set var3=0
  3. :A
  4. set /a var3=%var3%+1
  5. set var2=1000
  6. set var1=%random%
  7. echo %var1%
  8. if %var1% == %var2% echo Number=%var3%
  9. if %var1% == %var2% set var3=0
  10. if %var1% == %var2% pause
  11. goto A