NFL fantasy league draft batch program. Thoughts?
Posted: 08 Sep 2020 18:08
I'm trying to develop a fantasy league draft manager. I want it to color code players that get picked. The program seems to slow down when several players are selected. Any good ways to optimize this? I already feel like I am going to need a billion goto statements to update every players status.
Code: Select all
@echo off
cls
Set /A RB1=0
Set /A RB2=0
Set /A RB3=0
REM ======================
REM 2020 Draft Hero
REM ======================
:mainloop
cls
echo =====================
echo 2020 Draft Hero
echo =====================
echo.
echo RBs:
echo T1:
REM echo [001] Christian McCaffrey (CAR)
if %RB1%==0 echo [001] Christian McCaffrey (CAR)
if %RB1%==1 goto rb1show
:rb1return
REM echo [002] Saquon Barkley (NYG)
if %RB2%==0 echo [002] Saquon Barkley (NYG)
if %RB2%==1 goto rb2show
:rb2return
REM echo [003] Ezekiel Elliott (DAL)
if %RB3%==0 echo [003] Ezekiel Elliott (DAL)
if %RB3%==1 goto rb3show
:rb3return
echo [004] Alvin Kamara (NOR)
echo T2:
echo [005] Dalvin Cook (MIN)
echo [006] Derrick Henry (TEN)
echo [007] Clyde Edwards-Helaire (KAN)
echo [008] Austin Ekeler (LAC)
echo [009] Joe Mixon (CIN)
echo.
echo [x] exit
REM echo [WR] WR list
REM echo [RB] RB list
REM echo [QB] QB list
REM echo [TE] TE list
echo [123] number of player to draft (only 001, 002 and 003 have been coded so far)
REM get user input
set choice=
set /p choice=Draft a player!
if not '%choice%'=='' set choice=%choice:~0,3%
if '%choice%'=='x' goto end
if '%choice%'=='001' goto rb1
if '%choice%'=='002' goto rb2
if '%choice%'=='003' goto rb3
ECHO "%choice%" is not valid, try again
pause
goto mainloop
:rb1show
MD UniqueTempFolder
CD UniqueTempFolder
echo ^x>"DRAFTED CHRISTIAN MCCAFFREY (CAR)"
findstr /A:0e /S "x" "DRAFTED CHRISTIAN MCCAFFREY (CAR)"
CD..
RD /S /Q UniqueTempFolder
goto rb1return
:rb1
Set /A RB1=1
goto mainloop
:rb1show
:rb2show
MD UniqueTempFolder
CD UniqueTempFolder
echo ^x>"DRAFTED SAQUON BARKLEY (NYG)"
findstr /A:0e /S "x" "DRAFTED SAQUON BARKLEY (NYG)"
CD..
RD /S /Q UniqueTempFolder
goto rb2return
:rb2
Set /A RB2=1
goto mainloop
:rb2show
:rb3show
MD UniqueTempFolder
CD UniqueTempFolder
echo ^x>"DRAFTED EZEKIEL ELLIOTT (DAL)"
findstr /A:0e /S "x" "DRAFTED EZEKIEL ELLIOTT (DAL)"
CD..
RD /S /Q UniqueTempFolder
goto rb3return
:rb3
Set /A RB3=1
goto mainloop
:rb3show
:end