If you're not already familiar with the linuxquestions.org thread started by LQ member 'Beryllos' in January 2019, it has to do with a challenge to programmatically form equations equalling integers 0 through 100, using only the 4 digits found in '2019'. Allowable operations are simple digit concatenation (no leading zeroes), add, subtract, multiply, divide, and exponential power.
The page you are visiting is my (LQ member 'dogpatch') online answer to the challenge. It executes my C program residing on the server. Enter the year (any 4 digit number), and how much you want to display. Note that there may be many other possible equations for any given result value 0 thru 100; only one equation for each value is displayed here. As of version 1.0.100, where there are multiple equations for a given value, the program attempts to display an equation in which the digits appear in the same order as the original 4digit 'year' field. It also attempts to select for a briefer equation where possible.
As of version 2.0.000, the program uses Reverse Polish Notation (RPN) to generate the equations. As of version 3.0.000, it uses fractionalexponential math, as opposed to floatingpoint math. As of version 3.0.200, it accepts equation preferences from the user, defaulting to digits in original order and brief expressions as in version 1.0.100. Further updates represent refinements and minor bug fixes.
Versions 4 and 5 were never uploaded to the server, but were athome trials of using pregenerated lists of algebraic and RPN expressions, and of introducing decimal points. The history of this haphazard process is recorded at gx.php. Version 6.0.000 is the resulting program, and, with it, a move into the 'calc' folder of my website, rather than the 'tmp' folder where it originated. Further updates represent refinements and bug fixes.
^{*}To see a pregenerated list of all possible 4digit numbers and the number of equations formed for each, enter '0000' as the year, and select the first option 'Totals only'.
Javascript is not required, nor cookies nor stored data.
Questions, comments, or bug reports? Use my contact page, or visit the aforementioned linuxquestions.org thread. If you like, you may also download the C source code and its two header files for algebraic and rpn expression lists, and fracexp math header. Feel free to compile it on your own system, modifying as you see fit.
Title: LQ 2019 Challenge
concept by: LQ member Beryllos
coding by: LQ member dogpatch
version: 6.0.200
C program compiled (on server):
Fri May 17 2019 20:37:05 UTC
Remember: Writein "Tux" for president in 2020.
