Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal enabledelayedexpansion
- :::::::::::::::::::::::::::::::::::::::::
- ::Script Para Resolver Torres de Hanoi.::
- ::Creado por Hugo Guerrero (Guerrerohgp):
- :::::::::::::::::::::::::::::::::::::::::
- :ini
- set/p "cantidad=Ingrese el numero de discos en la torre: "
- if not defined cantidad goto:ini
- if !cantidad! lss 0 goto:ini
- call:algoritmoHanoi !cantidad! Torre_1 Torre_2 Torre_3
- pause
- exit
- :algoritmoHanoi
- setlocal
- if "%1" equ "0" goto:eof
- set/a "cnt=%1-1"
- call:algoritmoHanoi !cnt! %2 %4 %3
- echo.Mover disco %1 de %2 a %4
- call:algoritmoHanoi !cnt! %3 %2 %4
- endlocal
- goto:eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement