Introduction: Batch File Heads or Tails Generator

About: I like to computer program. I like soccer.

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



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