Batch File Heads or Tails Generator

by I_boom5245 in Circuits > Computers

2542 Views, 3 Favorites, 0 Comments

Batch File Heads or Tails Generator

cmd heads or tails.png

Code for a random heads or tails generator.

  1. Open notepad
  2. Copy code below
  3. Save it as ht.bat and click TEXT DOCUMENT and change it to ALL FILES
  4. Click save

@echo off

:top

cls

echo To flip the coin press enter

set /p enter=

set /a a=%random% %% 2+1

if %a% EQU 1 (

echo Heads pause goto top

)else echo Tails pause goto top