P5.js code for creating a calculator tip app confused

no :slight_smile: I suggest two things. If you right click on the code, there should be a “format code” option in the editor to format the spacing and indentation. This will make the scope of the code obvious - just try it to see how the indentation changes, and see how calculation function changes.

Another thing is, instead of the screenshot, please post your updated code :slight_smile: You can also share a link to your replit project if you want. Otherwise we don’t have your whole code, we cannot try it and we cannot give you a concrete answer or suggestions.

1 Like