Is there a better way to print a hangman figure?
FIG0 DB 0DH,0AH,' +=======+',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' ========+',0DH,0AH,'$'
FIG1 DB 0DH,0AH,' +=======+',0DH,0AH,' | |',0DH,0AH,' O |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' ========+',0DH,0AH,'$'
FIG2 DB 0DH,0AH,' +=======+',0DH,0AH,' | |',0DH,0AH,' O |',0DH,0AH,'/ |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' ========+',0DH,0AH,'$'
FIG3 DB 0DH,0AH,' +=======+',0DH,0AH,' | |',0DH,0AH,' O |',0DH,0AH,'/ \ |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' ========+',0DH,0AH,'$'
FIG4 DB 0DH,0AH,' +=======+',0DH,0AH,' | |',0DH,0AH,' O |',0DH,0AH,'/|\ |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' ========+',0DH,0AH,'$'
FIG5 DB 0DH,0AH,' +=======+',0DH,0AH,' | |',0DH,0AH,' O |',0DH,0AH,'/|\ |',0DH,0AH,' | |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' ========+',0DH,0AH,'$'
FIG6 DB 0DH,0AH,' +=======+',0DH,0AH,' | |',0DH,0AH,' O |',0DH,0AH,'/|\ |',0DH,0AH,' | |',0DH,0AH,'/ |',0DH,0AH,' |',0DH,0AH,' ========+',0DH,0AH,'$'
FIG7 DB 0DH,0AH,' +=======+',0DH,0AH,' | |',0DH,0AH,' O |',0DH,0AH,'/|\ |',0DH,0AH,' | |',0DH,0AH,'/ \ |',0DH,0AH,' |',0DH,0AH,' ========+',0DH,0AH,'$'
FIG8 DB 0DH,0AH,' +=======+',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' \O/ |',0DH,0AH,' | |',0DH,0AH,' | |',0DH,0AH,' / \ |',0DH,0AH,' ========+',0DH,0AH,'$'
Here is some nice figure. https://youtu.be/e2S_POws3DQ?t=42s
Its look really cool when he jump if you win game. I try to use call Clrscr and make him jump, but no luck.
First of all: Don't change your environment (Windows, 32-bit, Console, MASM, Irvine32)! You will meet a lot of people who suggest you to change it (Do it with BIOS, MS-DOS, Linux. Do it with GDI, OpenGL, DirectX. And so on.). You might solve a problem better with another environment, but you'll get new problems, which can be solved with changing the environment. At the end you'll quit the whole project - unfinished.
"$"
is the termination character of a MS-DOS string. In Windows/Irvine32 you handle with a null-termination.Even the Console mode of Windows is quite quick. So you need Irvine's
Delay
function to see an animation:ClrScr
is not ideal for your purpose since it clears the whole screen including the inputs. Use Irvine'sGotoXY
. Delete the old picture by writing spaces.