disasterpiece Posted February 27, 2008 at 05:01 PM Report Share #169463 Posted February 27, 2008 at 05:01 PM Este código não foi feito por mim, mas é muito giro. É o prograna do conhecido jogo ''Torres de Hanoi''. 😉 Program torreHanoi; uses wincrt; var n:integer; procedure hanoi(n:integer;a,b,c:char); {mova n discos do pino a para o pino b usando o pino c como auxiliar} begin if n=1 then writeln('mova o disco ',n,' do pino ',a,' para o pino ',b) else begin hanoi(n-1,a,c,b); writeln('mova o disco ',n,' do pino ',a,' para o pino ',b); hanoi(n-1,c,b,a) end end; begin read(n); hanoi(n,'A','B','C') end. Link to comment Share on other sites More sharing options...
sergiopinto Posted February 27, 2008 at 10:38 PM Report Share #169574 Posted February 27, 2008 at 10:38 PM Bom programa! 😉 Link to comment Share on other sites More sharing options...
_4ndr3 Posted March 25, 2008 at 02:12 PM Report Share #175220 Posted March 25, 2008 at 02:12 PM A interacção com o utilizador está fraca. 🙂 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now