This is a screenshot from my game, "One By One" in which a multiplication algebra problem was generated.

Feb 12th – Multiplication Algebra

Today’s mission was to finish the multiplication part of the algebra stage. What took me 2 hours probably could have taken 30 minutes, but that’s what hindsight is for. All of my coding was streamed on Twitch to try out something new. Which can be found here.

Also exciting news. I was able to talk to an Apple Developer representative and was able to elevate my case and should hear back sometime between the 15th and 19th so I can finally start sending out beta versions of my game.

Issues

Unnecessary Problem Generation

The biggest issue I was having was I was generating crazy, not useful, problems. For example, It would generate something like x*41=123. This is not very productive for helping people learn math. I also wanted to generate problems that were a*x*b=c however the main issue with this is that a*b*c can be quite limiting if you want the answer to be less than or equal to 144.

Infinite Loop

I once again hit another infinite loop. Thankfully this time around I already had saved my Unity game scene so I could exit out of the problem no worries. The loop happened because of faulty logic in a while loop.

Final Version

After all said and done Occam’s razor prevails and the code is quite simple compared to what it was previously.

void algebraMultiplicationProblem(int min, int max){
    Text prompt = problemPrompt.GetComponent<Text>();
    a = UnityEngine.Random.Range(min, max+1);
    b = UnityEngine.Random.Range(min, max+1);
    c = UnityEngine.Random.Range(min, max+1);
        // x*{a}={b} => x=b/a;
        // {a}*x={b} => x=b/a;
    divisionQuickLoop(1, min, max);
    x=b/a;
    if(randomPercent >= 50){ displayPrompt($"x*{a}={b}", 17); }
    else { displayPrompt($"{a}*x={b}", 18); }
}

I also recorded a video to help those who might need help with bringing a project from Unity onto an iOS device.

What is Next?

I hope to add the division system to the next time I code. I will also probably try to stream my coding again. Over time I am hoping that my streams will pick up a little more traffic towards the game. I do have a plan for advertising the game when it comes out.

Leave a Reply

Share :

Twitter
Telegram
WhatsApp