PE29) Quadratic Formula

Quadratic formula: x= (-b +- (b^2-4ac)^(1/2)) / (2a)
Prompt the user for 3 digits, one for A,B and C.  Solve for x.

Show Code

Oops! You must be logged in as a PRO MEMBER to see the code for this post. If you're a returning member, please click the LOGIN tab above to log in. If you're not a member yet, head over the Home page and scroll down to SIGN UP 🙂

PE30) Fill The Console With Random Characters And Colors

Use this code as a starter.

Include Irvine32.inc
.data
	outHandle HANDLE ?
	cellsWritten DWORD ?
	xyPos COORD <0,0>
	buffer DWORD 4000 DUP(?)
	BufSize DWORD 4000
	attributes DWORD 4000 DUP(?)
.code
main PROC
        call Randomize
;procedure to fill buffer needed
;procedure to set color needed

	INVOKE GetStdHandle,STD_OUTPUT_HANDLE
	mov outHandle,eax

	INVOKE WriteConsoleOutputAttribute,
	outHandle, ADDR attributes,
	BufSize, xyPos, ADDR cellsWritten

	INVOKE WriteConsoleOutputCharacter,
	outHandle, ADDR buffer, BufSize,
	xyPos, ADDR cellsWritten

	exit
main ENDP
END main

Show Code

Oops! You must be logged in as a PRO MEMBER to see the code for this post. If you're a returning member, please click the LOGIN tab above to log in. If you're not a member yet, head over the Home page and scroll down to SIGN UP 🙂

PE31) Block Animation

Write a program that draws a small square on the screen using several blocks (ASCII code DBh) in color.  Move the square around the screen in randomly generated directions.  Use a fixed delay value of 50 milliseconds.

Show Code

Oops! You must be logged in as a PRO MEMBER to see the code for this post. If you're a returning member, please click the LOGIN tab above to log in. If you're not a member yet, head over the Home page and scroll down to SIGN UP 🙂

PE32) Chessboard Color Animation

The program displays chessboard and changes to all 16 colors.  8X8 chessboard,  Every 500 milliseconds the color changes.

Show Code

Oops! You must be logged in as a PRO MEMBER to see the code for this post. If you're a returning member, please click the LOGIN tab above to log in. If you're not a member yet, head over the Home page and scroll down to SIGN UP 🙂