stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

Chalculator

  • 6 Devlogs
  • 4 Total hours

This is another Java game where players see numbers, operators, and the answer and have to guess the original equation.

Ship #1

This is a game where the user sees a list of numbers (1~9) and operators (+, -, *, and /) to assemble an equation that will equal the answer presented on the screen. What makes the game quite challenging is that numbers can be combined to make other numbers, so a 2 and a 4 can be used to create numbers like 24 and 42. There is therefore a lot of possible combinations, and that’s why I believe the game is a great challenge for mathematics lovers (like me!). I can envision a “duel” where two players compete to solve questions faster than others.

The challenging part was using the String from the user’s entered equation and using that to calculate the answers. This is because there were many cases where answers should not be accepted (for example not using all the numbers), and tracking a numerical answer is difficult when the original input is in Strings. I was able to calmly visualise how the code should handle them and successfully worked to implement the method. It was indeed challenging because the code used a lot more than a hundred lines, which is more than what I wrote in a lot of my previous works!

  • 6 devlogs
  • 4h
Try project → See source code →
Open comments for this post

46m 3s logged

Today I finished working on implementing a difficulty system. It took a long time because I had to change standard arrays into ArrayLists and there were numerous IndexOutOfBounds issues. But while checking for errors I also caught an unrelated missing return statement that just so happened to never be reached while I was playtesting, so that’s nice. I am now planning to ship it soon!

0
0
24
Open comments for this post

20m logged

Today I spent most of the time fixing errors. It’s now ready to be played and I will ship it shortly.

  • The answer was always rounded to the nearest integer, so it kept displaying a 0 when that’s physically impossible (it was supposed to display a decimal value 0~1). I fixed it by changing the casting error. Now it correctly rounds to the nearest 10^-6.
  • I slightly modified the introduction to reword any unclear details.
  • LetsCheck wasn’t functioning correctly, and I had no idea how to fix the implementation. I consulted AI to fix it, because I tried to come up with an idea (using a complex parsing method) for around half an hour and that ultimately didn’t work.

I have to admit, this game is very challenging. I plan to introduce a difficulty setting, in a later version.

0
0
19
Open comments for this post

51m 38s logged

Today I started debugging the programme. The compilation errors were very easy to solve, especially with the densely-populated progress messages. It was eventually realised that this was an error due to wrong variables taking the place. However, I noticed a critical logic error when the code compiled, giving out incomprehensible answers. I suspected that this was a problem in calculating the answer because all the invalid answers were correctly flagged. I eventually noticed that this was because I didn’t reset the numbers whenever the operator was keyed in…

But even then I still have no idea why it’s producing nonsense. For some reason it thinks 568*9+2 = 9.0, even though I’m very sure my implementation is already correct. I feel like giving up because I can’t debug since AI is also spitting out nonsense right now.

1
0
74
Open comments for this post

36m 9s logged

Today I finished coding the answerVerify method. While coding the method, though, I thought of rounding the answer so the answer doesn’t fill the entire line and allow the user’s equation’s answer to be off by a small amount. What I didn’t notice before was that that meant my answers variable should be a double, not an int. I had to go and change a lot of parts where an int was used rather than a double, and that took a good amount of time. Now, I am able to run the code, but I’d need to fix these OutOfBoundsErrors (I’m not frustrated because I didn’t expect it, but I can’t identify where it is)… that will take time. I will use the “loading message” method I described before to locate the error, since these error messages are impossible to interpret (at least for me) unless you use AI. (image caption: OK, the error is between 2% and 3%)

0
0
19
Open comments for this post

22m 25s logged

Today, I finished the questionGenerator() method, and now I am on my way to make the answerVerify() method which checks if the answer the user entered is valid and correct. But even right now, this game is starting to have a lot of lines (it’s one of the most I wrote for a single project), and personally I find it hard to keep track of what it does. I feel that that would become a genuine struggle when I test the game in the future. There would be simply too many lines to correctly pinpoint the problem. It is night time right now, so I will find the error tomorrow. I plan to have loading messages printed to the console for every step to see where the code is experiencing a problem (e.g. “values generated!”, “equation assembled!”, etc.). This means the code compiled correctly up to the last loading message and that’s where the error might be.

0
0
9
Open comments for this post

56m logged

I completed the game introduction that loads when the user first loads the game, so they will know how to play it. The questionGenerator method is quite a challenge because I’d need to ensure there are the correct number of values. One too few, there might be an awkward plus on the end. One too many, it looks like a 1259 when it is supposed to be 12 and 59 (or even 1 and 259, for that matter). I had to pay special attention to ensure there are no off-by-one errors. In the future, I would need to work on a method that evaluates whether the user entered a valid formula. I feel that would be hard because converting Strings to operations will be difficult, but I’m thinking of a solution that scans each character of the answer and conduct operations accordingly.

0
0
36

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…