*INPUT YOUR OWN NUMBERS AT https://scratch.mit.edu/projects/288491421/* *INPUT YOUR OWN OPERATIONS AT https://scratch.mit.edu/projects/293638056/* This project takes any number three digits or more and forms an equation with its digits. The program tries all four operations -Plus, Minus, Times, and Divide- to see if the new found equation is solvable. EXAMPLE: The number 369. This becomes 3_6=9 An operation must fill the blank. If a given operation solves the equation, the number is added to the 'Solvable List" with the operation. 3+6=9 Since three plus six equals nine, this number is solvable. The program will test all other operation combinations to see if the number has multiple solutions, and will add those as well. EXAMPLE: The number 909. 9+0=9, as well as 9-0=9. Both get added into the 'Solvable' list. Nine times 0 isn't nine, but since there are already solutions, the number stays away from the unsolvable list. EXAMPLE: The number 5,128. 5_1_2=8 Since there are two operations that are done for this number, there are quadruple the combinations. The operations that complete this are: 5+1+2=8 We begin to see more numbers that are solvable and with more solutions. Also for 5,128: 5-1*2=8 As with prime numbers, unsolvable numbers become rarer and rarer. EXAMPLE: The number 95,637. This one is fun. 9 5 6 3=7 An easy way to solve is by: 9-5+6-3=7 But... the program discovered a second, easily overlook-able solution. 9+5/6*3=7 This solution is so intriguing since it dives into fractions. 14/6=7/3, and 7/3 times 3 just so happens to simplify into 7. While installing 5 digit capability was difficult, it was certainly worth it. EXAMPLE: The number 11,111. This one is insane. There are TWENTY solutions to this number- the most out of any 5 digit numbers i believe. This is because the program can do almost all solutions involving dividing or multiplying, since 1/1 or 1*1 is 1. EXAMPLE: ANY number ending in two zeros is solvable by plenty of operation combinations. Why? Lets take 15,600. Do whatever you want with the first 3 digits- multiply, divide, add, subtract- as long as you multiply your answer by 0. You always get 0, the number you're solving for. In this case- 1+5-6 equals 0, so you then aren't limited to just multiplying. But most don't have a combination of the first three digits to result in zero, like 18,300. I dub this the Double Zero Postulate, or DZP (Though the more zeros, the more solutions). The zeros needn't be consecutive. 198,010 is solvable by DZP as long as you multiply the answer of the first three digits by 0 and multiply anything between the first and last zero. You'll always get 0, and the more numbers before the first zero, the more combinations. SCRATCH CODE ISSUE Just discovered a very strange and very annoying issue with the processing of mathematical calculations. Take this example- 1_0_0_0_0=0 The program provided, among others, a solution like this- 1/0x0x0-0=0 1/0 is not possible, so the program labels it as infinity. Then it tries to multiply infinity by 0, which gets NaN (a value that is not a number). Then comes the issue- Scratch code believes that NaN times 0 equals 0. So we went from infinity to a non number to 0- A SOLUTION. Kinda cool, but it is inaccurate as hell. I hope the Scratch team notices and fixes this. But for the meantime, I will institute a piece of code that automatically throws out the current solution if it detects Nan/Infinity. Will be fixed soon.
****THIS PROGRAM DOES NOT USE PEMDAS!!!**** It simply goes from left to right for operations. I may one day implement PEMDAS, but I have no plans to currently. Not many numbers are affected by this, though some are. Take 6,391. Program says 6+3/9=1, which is only possible by neglecting the Order Of Operations property. Currently the 'What Number You Want?' feature is unable to detect letters in your answers; it just says the 'number' is solvable. I'm working to fix this. I am unsure if I wish to expand into the 6 digit realm. Five digits takes a good 30-40 seconds to complete vs the 1 second for four digits. Six digits would likely take many minutes to complete. I may just create a separate project for them (AND it will require 256 modules. Very tedious). February 20th- VERSION 2.0 IS RELEASED! This version is SUPER easy to expand, so I am working to allow 6 digit capability. February 21rst- 6 DIGIT CAPABILITY! This is HUGE. But it is slow as hell. Don't know if I can speed it up. It takes like 10 minutes to complete so that sucks. But its here! And this new system is easily expandable. March 14th 2020- Updates Recently regained interest in this, and I am working on it and I have noticed something odd. -Completed v1 of new calculating sytem, paving the way for 7 digit capability. HELLA slow tho, so looking to improve it somehow. -Testing new system that pre-generates all possible operation combinations so I don't have to type them out. They are put into a seperate list and the program pulls from it. Expanding should be FAR easier/less time consuming now. -Noticed issue with Scratch's calculations that can sometimes provide false answers. Explained more in depth in Instructions. Working to find a fix.