Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Tuesday, November 25, 2008

Javascript Slot Machine Simulator

Slots Game! Click the button to play.
Each play costs $1.

Win Values

= $20
= $40
= $50
= $75
= $100
= $150

$

I'm very happy with how this turned out. It was coded mostly by trial and error in my pursuit of learning javascript.

I am less happy with how blogspot treats javascript. I spent many frustrated minutes wondering why my code wouldn't work until I discovered that blogspot automatically inserts html line breaks into my code, which breaks it. I finally found this feature in Settings and turned it off. Also, picasa failed at hosting my slot machine images, and I had to revert to photobucket. I am still pleased with the final result, and would appreciate any critique if any could be offered.

Tuesday, November 18, 2008

Javascript Quadratic Equation Calculator

Quadratic Equation Calculator
0 = ax2 + bx + c. Enter a, b, and c to solve for x.

a: b: c:
x = or
I'm rather proud of this. I'm just starting to teach myself javascript, and this is my first script that actually does something. If there's any critique, I'd love to hear it. Even better, if there are suggestions for further beginner projects, I'd love even more to hear them.