Feedback and help finding bug

Feedback and help finding bug
0

#1

project link: http://codepen.io/YUGANO/pen/amWRQo
Hi everyone. I looked at lots of calculator code and realize that there is a relation between numbers, operator and dot but most of the codes include calculating every situation independently every time. so i want to create a little bit different logic like that.

  • at first you have to type number so i created a boolean “sayi” assign false to it and put it in operator, dot and equal buttons logic mechanism. you cant type any of them until type number is pushed.
  • then created boolean “noktakilit” for dot button. it is true at the beginning but if you push dot button once, it make noktakilit false and it is only became true if you type operator button. you must follow that order dot number operator number. they lock and open each other in turn.
  • operators are simple they just have a sayi boolean. you can type after type at least one number.
  • equal requires two boolean sayi and sonuckilit. sonuckilit is changed when you type operator button at least once and you can type equal button after that.
  • the hardest part is to make clear buttons logic. it check last element and in some case last two element to transform booleans former situation.
  • and there is possibility of error because there are too much combination and i am not sure i did handle it all. so i want your help to find issue.

I am waiting for your repsonce and feedback because i made first time a project :). I skipped all project until now and this is my favorite project because this involves math, making logic, only built in objects.


#2

Hi, @yugano
I tried to change the css of the button, but had no effect on it. You can try to use -webkit-appearance:none or maybe outline: none; in the button css. Can you check if it works?


#3

@andrebrito thaks it changed it. i couldnt find it by myself and i wonder what is the reason of this ?


#4

That square is probably the default selection mechanism of the browser. If you remove it through css you’re explicitly saying that you don’t want that selection item to show up in the elements of the webpage. If you used the -webkit-appearance maybe won’t work on IE, Edge or Firefox.