Post History
The goal is to write a program, whose byte size is minimized, that inputs four integers, not necessarily distinct, chosen from $1, 2, 3, ..., 9$ and then determines if it is possible to combine the...
#4: Post edited
- The goal is to write a program, whose byte size is minimized, that inputs four integers, not necessarily distinct, chosen from $1, 2, 3, ..., 9$ and then determines if it is possible to combine the inputted numbers using only the operations of addition, subtraction, multiplication and division to form a mathematical expression whose value is $24$. Parentheses are allowed.
- If it is possible, the program displays an expression whose value is $24$.
- Otherwise, the program displays the word "Impossible", `false`, 0 or something similar; the choice is yours as long as you are consistent.
- By "display", I mean any output (such as displaying on the screen or the return value of a function).
- ## Clarifications:
- You may choose any input format you like as long as you use the same format for all test cases.
- You may choose any output format you like for expressions such as normal mathematical notation OR Reverse Polish Notation OR …
- The expression you form must contain each inputted number exactly once.
- You may only use the four arithmetic operations mentioned above, so no square roots, no factorials, …
- Although subtraction is allowed, the use of a negative sign is not allowed. Similarly, negation of a number or expression is not allowed.
- Decimal points are not allowed.
- Assume everything is done in base $10$.
- Concatenation in any form is not allowed.
- ## Test cases:
- There may be multiple ways for the inputted numbers to form $24$. Your program only needs to display one such expression, not necessarily the ones listed below.
- 3357 -> 3(3x5-7)
- 1346 -> 6/(1-3/4)
- 3377 -> 7(3+3/7)
- 3388 -> 8/(3-8/3)
- 1116 -> Impossible
- 1179 -> Impossible
- 1557 -> Impossible
- 1577 -> Impossible
- 1277 -> (7x7-1)/2
- 1668 -> 6/(1-6/8)
- 5599 -> 5x5-9/9
- 2244 -> 2(2x4+4)
- 2222 -> Impossible
- 3358 -> Impossible
- 3467 -> Impossible
- 7899 -> Impossible
- ---
- If you wish you can try my 24 Game solver available here:
- https://openprocessing.org/sketch/2927650
- You interact with my program with finger taps or mouse clicks.
- The goal is to write a program, whose byte size is minimized, that inputs four integers, not necessarily distinct, chosen from $1, 2, 3, ..., 9$ and then determines if it is possible to combine the inputted numbers using only the operations of addition, subtraction, multiplication and division to form a mathematical expression whose value is $24$. Parentheses are allowed.
- If it is possible, the program displays an expression whose value is $24$.
- Otherwise, the program displays the word "Impossible", `false`, 0 or something similar; the choice is yours as long as you are consistent.
- By "display", I mean any output (such as displaying on the screen or the return value of a function).
- ## Clarifications:
- You may choose any input format you like as long as you use the same format for all test cases.
- You may choose any output format you like for expressions such as normal mathematical notation OR Reverse Polish Notation OR …
- The expression you form must contain each inputted number exactly once.
- You may only use the four arithmetic operations mentioned above, so no square roots, no factorials, …
- Although subtraction is allowed, the use of a negative sign is not allowed. Similarly, negation of a number or expression is not allowed.
- Decimal points are not allowed.
- Assume everything is done in base $10$.
- Concatenation in any form is not allowed.
- ## Test cases:
- There may be multiple ways for the inputted numbers to form $24$. Your program only needs to display one such expression, not necessarily the ones listed below.
- 3357 -> 3(3x5-7)
- 1346 -> 6/(1-3/4)
- 3377 -> 7(3+3/7)
- 3388 -> 8/(3-8/3)
- 1116 -> Impossible
- 1179 -> Impossible
- 1557 -> Impossible
- 1577 -> Impossible
- 1277 -> (7x7-1)/2
- 1668 -> 6/(1-6/8)
- 5599 -> 5x5-9/9
- 2244 -> 2(2x4+4)
- 2222 -> Impossible
- 3358 -> Impossible
- 3467 -> Impossible
- 7899 -> Impossible
- 3333 -> 3x3x3-3
- ---
- If you wish you can try my 24 Game solver available here:
- https://openprocessing.org/sketch/2927650
- You interact with my program with finger taps or mouse clicks.
#3: Post edited
- The goal is to write a program, whose byte size is minimized, that inputs four integers, not necessarily distinct, chosen from $1, 2, 3, ..., 9$ and then determines if it is possible to combine the inputted numbers using only the operations of addition, subtraction, multiplication and division to form a mathematical expression whose value is $24$. Parentheses are allowed.
- If it is possible, the program displays an expression whose value is $24$.
Otherwise, the program displays the word "Impossible".- By "display", I mean any output (such as displaying on the screen or the return value of a function).
- ## Clarifications:
- You may choose any input format you like as long as you use the same format for all test cases.
- You may choose any output format you like for expressions such as normal mathematical notation OR Reverse Polish Notation OR …
- The expression you form must contain each inputted number exactly once.
- You may only use the four arithmetic operations mentioned above, so no square roots, no factorials, …
- Although subtraction is allowed, the use of a negative sign is not allowed. Similarly, negation of a number or expression is not allowed.
- Decimal points are not allowed.
- Assume everything is done in base $10$.
- Concatenation in any form is not allowed.
- ## Test cases:
- There may be multiple ways for the inputted numbers to form $24$. Your program only needs to display one such expression, not necessarily the ones listed below.
- 3357 -> 3(3x5-7)
- 1346 -> 6/(1-3/4)
- 3377 -> 7(3+3/7)
- 3388 -> 8/(3-8/3)
- 1116 -> Impossible
- 1179 -> Impossible
- 1557 -> Impossible
- 1577 -> Impossible
- 1277 -> (7x7-1)/2
- 1668 -> 6/(1-6/8)
- 5599 -> 5x5-9/9
- 2244 -> 2(2x4+4)
- 2222 -> Impossible
- 3358 -> Impossible
- 3467 -> Impossible
- 7899 -> Impossible
- ---
- If you wish you can try my 24 Game solver available here:
- https://openprocessing.org/sketch/2927650
- You interact with my program with finger taps or mouse clicks.
- The goal is to write a program, whose byte size is minimized, that inputs four integers, not necessarily distinct, chosen from $1, 2, 3, ..., 9$ and then determines if it is possible to combine the inputted numbers using only the operations of addition, subtraction, multiplication and division to form a mathematical expression whose value is $24$. Parentheses are allowed.
- If it is possible, the program displays an expression whose value is $24$.
- Otherwise, the program displays the word "Impossible", `false`, 0 or something similar; the choice is yours as long as you are consistent.
- By "display", I mean any output (such as displaying on the screen or the return value of a function).
- ## Clarifications:
- You may choose any input format you like as long as you use the same format for all test cases.
- You may choose any output format you like for expressions such as normal mathematical notation OR Reverse Polish Notation OR …
- The expression you form must contain each inputted number exactly once.
- You may only use the four arithmetic operations mentioned above, so no square roots, no factorials, …
- Although subtraction is allowed, the use of a negative sign is not allowed. Similarly, negation of a number or expression is not allowed.
- Decimal points are not allowed.
- Assume everything is done in base $10$.
- Concatenation in any form is not allowed.
- ## Test cases:
- There may be multiple ways for the inputted numbers to form $24$. Your program only needs to display one such expression, not necessarily the ones listed below.
- 3357 -> 3(3x5-7)
- 1346 -> 6/(1-3/4)
- 3377 -> 7(3+3/7)
- 3388 -> 8/(3-8/3)
- 1116 -> Impossible
- 1179 -> Impossible
- 1557 -> Impossible
- 1577 -> Impossible
- 1277 -> (7x7-1)/2
- 1668 -> 6/(1-6/8)
- 5599 -> 5x5-9/9
- 2244 -> 2(2x4+4)
- 2222 -> Impossible
- 3358 -> Impossible
- 3467 -> Impossible
- 7899 -> Impossible
- ---
- If you wish you can try my 24 Game solver available here:
- https://openprocessing.org/sketch/2927650
- You interact with my program with finger taps or mouse clicks.
#2: Post edited
- The goal is to write a program, whose byte size is minimized, that inputs four integers, not necessarily distinct, chosen from $1, 2, 3, ..., 9$ and then determines if it is possible to combine the inputted numbers using only the operations of addition, subtraction, multiplication and division to form a mathematical expression whose value is $24$. Parentheses are allowed.
- If it is possible, the program displays an expression whose value is $24$.
- Otherwise, the program displays the word "Impossible".
- ## Clarifications:
- You may choose any input format you like as long as you use the same format for all test cases.
- You may choose any output format you like for expressions such as normal mathematical notation OR Reverse Polish Notation OR …
- The expression you form must contain each inputted number exactly once.
- You may only use the four arithmetic operations mentioned above, so no square roots, no factorials, …
- Although subtraction is allowed, the use of a negative sign is not allowed. Similarly, negation of a number or expression is not allowed.
- Decimal points are not allowed.
- Assume everything is done in base $10$.
- Concatenation in any form is not allowed.
- ## Test cases:
- There may be multiple ways for the inputted numbers to form $24$. Your program only needs to display one such expression, not necessarily the ones listed below.
- 3357 -> 3(3x5-7)
- 1346 -> 6/(1-3/4)
- 3377 -> 7(3+3/7)
- 3388 -> 8/(3-8/3)
- 1116 -> Impossible
- 1179 -> Impossible
- 1557 -> Impossible
- 1577 -> Impossible
- 1277 -> (7x7-1)/2
- 1668 -> 6/(1-6/8)
- 5599 -> 5x5-9/9
- 2244 -> 2(2x4+4)
- 2222 -> Impossible
- 3358 -> Impossible
- 3467 -> Impossible
- 7899 -> Impossible
- ---
- If you wish you can try my 24 Game solver available here:
- https://openprocessing.org/sketch/2927650
- You interact with my program with finger taps or mouse clicks.
- The goal is to write a program, whose byte size is minimized, that inputs four integers, not necessarily distinct, chosen from $1, 2, 3, ..., 9$ and then determines if it is possible to combine the inputted numbers using only the operations of addition, subtraction, multiplication and division to form a mathematical expression whose value is $24$. Parentheses are allowed.
- If it is possible, the program displays an expression whose value is $24$.
- Otherwise, the program displays the word "Impossible".
- By "display", I mean any output (such as displaying on the screen or the return value of a function).
- ## Clarifications:
- You may choose any input format you like as long as you use the same format for all test cases.
- You may choose any output format you like for expressions such as normal mathematical notation OR Reverse Polish Notation OR …
- The expression you form must contain each inputted number exactly once.
- You may only use the four arithmetic operations mentioned above, so no square roots, no factorials, …
- Although subtraction is allowed, the use of a negative sign is not allowed. Similarly, negation of a number or expression is not allowed.
- Decimal points are not allowed.
- Assume everything is done in base $10$.
- Concatenation in any form is not allowed.
- ## Test cases:
- There may be multiple ways for the inputted numbers to form $24$. Your program only needs to display one such expression, not necessarily the ones listed below.
- 3357 -> 3(3x5-7)
- 1346 -> 6/(1-3/4)
- 3377 -> 7(3+3/7)
- 3388 -> 8/(3-8/3)
- 1116 -> Impossible
- 1179 -> Impossible
- 1557 -> Impossible
- 1577 -> Impossible
- 1277 -> (7x7-1)/2
- 1668 -> 6/(1-6/8)
- 5599 -> 5x5-9/9
- 2244 -> 2(2x4+4)
- 2222 -> Impossible
- 3358 -> Impossible
- 3467 -> Impossible
- 7899 -> Impossible
- ---
- If you wish you can try my 24 Game solver available here:
- https://openprocessing.org/sketch/2927650
- You interact with my program with finger taps or mouse clicks.
#1: Initial revision
24 game automated solver
The goal is to write a program, whose byte size is minimized, that inputs four integers, not necessarily distinct, chosen from $1, 2, 3, ..., 9$ and then determines if it is possible to combine the inputted numbers using only the operations of addition, subtraction, multiplication and division to form a mathematical expression whose value is $24$. Parentheses are allowed. If it is possible, the program displays an expression whose value is $24$. Otherwise, the program displays the word "Impossible". ## Clarifications: You may choose any input format you like as long as you use the same format for all test cases. You may choose any output format you like for expressions such as normal mathematical notation OR Reverse Polish Notation OR … The expression you form must contain each inputted number exactly once. You may only use the four arithmetic operations mentioned above, so no square roots, no factorials, … Although subtraction is allowed, the use of a negative sign is not allowed. Similarly, negation of a number or expression is not allowed. Decimal points are not allowed. Assume everything is done in base $10$. Concatenation in any form is not allowed. ## Test cases: There may be multiple ways for the inputted numbers to form $24$. Your program only needs to display one such expression, not necessarily the ones listed below. 3357 -> 3(3x5-7) 1346 -> 6/(1-3/4) 3377 -> 7(3+3/7) 3388 -> 8/(3-8/3) 1116 -> Impossible 1179 -> Impossible 1557 -> Impossible 1577 -> Impossible 1277 -> (7x7-1)/2 1668 -> 6/(1-6/8) 5599 -> 5x5-9/9 2244 -> 2(2x4+4) 2222 -> Impossible 3358 -> Impossible 3467 -> Impossible 7899 -> Impossible --- If you wish you can try my 24 Game solver available here: https://openprocessing.org/sketch/2927650 You interact with my program with finger taps or mouse clicks.
