Who says love needs to be used to only make games..
I got bored so I created a simple calculator, doing this also helped with me learning a few things with lua since I'm still newish to it.
Edit, made the buttons cooler, but still not OO.
Still also has the errors if you do things like 1**1, dunno what to do about that
p.s. Someone should look at my code and tell me if I'm going in the right direction.
Simple Calculator
Simple Calculator
Last edited by BarnD on Tue Apr 26, 2011 1:51 pm, edited 3 times in total.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Denver, CO
- Contact:
Re: Simple Calculator
1 * * 1
Re: Simple Calculator
+TechnoCat wrote:1 * * 1
BarnD wrote:Simple Calculator
=
calculator too dumb to do that
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Denver, CO
- Contact:
Re: Simple Calculator
Your code is pretty good, but your buttons could use an OO makeover.
Instead of hard-coding a switch statement into your button function, you could have a button object that accepts a function instead.
Instead of hard-coding a switch statement into your button function, you could have a button object that accepts a function instead.
Re: Simple Calculator
Yeah, I need to read up on my OOP.TechnoCat wrote:your buttons could use an OO makeover
And thanks for your feedback.
Who is online
Users browsing this forum: Semrush [Bot] and 32 guests