Post History
#11: Post edited
A chunk of symbols is a calculation [released]
# Challenge Create a program that takes input of a string and outputs an integer using the following calculation system: - The string can only contain `+`, `-`, `*`, `/`, `^`, `!` (or a different character; `!` is used here for demonstration), `(`, and `)`. - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`. - Here are the operations of each symbol: - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`) - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`) - - `*` is multiplication. (`**` = `* 2`) - - `/` is division. (`//////` = `/ 6`) - - `^` is exponentiation/ (`^^^` = `^ 3`) - - `!` or a different character (I'm using `!` for demonstration) is for assigning positive integers if we want to add positive integers together, or to simply separate positive integers from each other. - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`) - The output must be an integer, being the result of the whole equation. - The whole system should follow [this non-standard model of PEMDAS](https://math.berkeley.edu/~gbergman/misc/numbers/ord_ops.html). - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins. # Testcases - `+++++` is `+ 5` which returns `5`. - `---**` is `-3 * 2` which returns `-6`. - `++(----//+++++!!!**)` is `2(-4 / 2 + 5 + 3 * 2)` which returns `18` (`2(-2 + 5 + 6) => 2(9)`). - `--^^^` is `-2 ^ 3` which returns `-8`. - An empty input or `()` is `0` which returns `0`. - `(+-)/(+-)` is `(1 - 1) / 1 (1 - 1)` is indeterminate, but for the sake of this challenge, it returns `0`. - `(++++++++******)//((+++***)+++)` is `(8 * 6) / 2((3 * 3) + 3)` which returns `2` (`48 / 2(9 + 3) => 48 / 24`). # Error Handling Everything in this section is [undefined behavior](https://codegolf.codidact.com/comments/thread/3915#comment-12400). Please DON'T do these when inputting. - A character that's not supposed to be there. - A beginner number is assigned NOT by `+`, `-`, `!` (or a different character), or `(`. - An open parentheses doesn't have a paired closed parentheses. - A whitespace character in the string (tabs, spaces, etc.). - Characters that aren't part of the English alphabet. `ñ`, `る` and `θ` are examples. - An equation like `!/(+-)` or `1 / 1(1-1)` leads to the division by zero error. Refrain from doing such equations in the input. Only `0 / 0` is an exception here, which returns `0`. # Suggestions - Any way to improve this? - Anything unclear? - Are these the right tags? - Any more errors to handle?
#10: Post edited
A chunk of symbols is a calculation [in test]
- A chunk of symbols is a calculation [released]
#8: Post edited
> This is a test release of [this sandbox post](https://codegolf.codidact.com/posts/283231). If this challenge is well-received, then this quote box will be deleted, officially stating that the challenge can stay.- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- - The string can only contain `+`, `-`, `*`, `/`, `^`, `!` (or a different character; `!` is used here for demonstration), `(`, and `)`.
- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `!` or a different character (I'm using `!` for demonstration) is for assigning positive integers if we want to add positive integers together, or to simply separate positive integers from each other.
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- `---**` is `-4 * 2` which returns `-6`.- `++(----//+++++!!!**)` is `2(-4 / 2 + 5 + 3 * 2)` which returns `18`.- - `--^^^` is `-2 ^ 3` which returns `-8`.
- - An empty input or `()` is `0` which returns `0`.
- `(+-)/(+-)` is `1 / 1 (1 - 1)` is `undefined`, but fr the sake of this challenge, it returns `0`.- # Error Handling
- Everything in this section is [undefined behavior](https://codegolf.codidact.com/comments/thread/3915#comment-12400). Please DON'T do these when inputting.
- - A character that's not supposed to be there.
- - A beginner number is assigned NOT by `+`, `-`, `!` (or a different character), or `(`.
- - An open parentheses doesn't have a paired closed parentheses.
- - A whitespace character in the string (tabs, spaces, etc.).
- - Characters that aren't part of the English alphabet. `ñ`, `る` and `θ` are examples.
- An equation like `!/(+-)` or `1 / 1(1-1)` leads to the division by zero error. Refrain from doing such equations in the input.- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- - The string can only contain `+`, `-`, `*`, `/`, `^`, `!` (or a different character; `!` is used here for demonstration), `(`, and `)`.
- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `!` or a different character (I'm using `!` for demonstration) is for assigning positive integers if we want to add positive integers together, or to simply separate positive integers from each other.
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow [this non-standard model of PEMDAS](https://math.berkeley.edu/~gbergman/misc/numbers/ord_ops.html).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-3 * 2` which returns `-6`.
- - `++(----//+++++!!!**)` is `2(-4 / 2 + 5 + 3 * 2)` which returns `18` (`2(-2 + 5 + 6) => 2(9)`).
- - `--^^^` is `-2 ^ 3` which returns `-8`.
- - An empty input or `()` is `0` which returns `0`.
- - `(+-)/(+-)` is `(1 - 1) / 1 (1 - 1)` is indeterminate, but for the sake of this challenge, it returns `0`.
- - `(++++++++******)//((+++***)+++)` is `(8 * 6) / 2((3 * 3) + 3)` which returns `2` (`48 / 2(9 + 3) => 48 / 24`).
- # Error Handling
- Everything in this section is [undefined behavior](https://codegolf.codidact.com/comments/thread/3915#comment-12400). Please DON'T do these when inputting.
- - A character that's not supposed to be there.
- - A beginner number is assigned NOT by `+`, `-`, `!` (or a different character), or `(`.
- - An open parentheses doesn't have a paired closed parentheses.
- - A whitespace character in the string (tabs, spaces, etc.).
- - Characters that aren't part of the English alphabet. `ñ`, `る` and `θ` are examples.
- - An equation like `!/(+-)` or `1 / 1(1-1)` leads to the division by zero error. Refrain from doing such equations in the input. Only `0 / 0` is an exception here, which returns `0`.
- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
#7: Post edited
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- - The string can only contain `+`, `-`, `*`, `/`, `^`, `!` (or a different character; `!` is used here for demonstration), `(`, and `)`.
- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `!` or a different character (I'm using `!` for demonstration) is for assigning positive integers if we want to add positive integers together, or to simply separate positive integers from each other.
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-4 * 2` which returns `-6`.
- - `++(----//+++++!!!**)` is `2(-4 / 2 + 5 + 3 * 2)` which returns `18`.
- - `--^^^` is `-2 ^ 3` which returns `-8`.
- An empty input is `0` which returns `0`.- # Error Handling
- Everything in this section is [undefined behavior](https://codegolf.codidact.com/comments/thread/3915#comment-12400). Please DON'T do these when inputting.
- - A character that's not supposed to be there.
- - A beginner number is assigned NOT by `+`, `-`, `!` (or a different character), or `(`.
- - An open parentheses doesn't have a paired closed parentheses.
- - A whitespace character in the string (tabs, spaces, etc.).
- - Characters that aren't part of the English alphabet. `ñ`, `る` and `θ` are examples.
- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
- > This is a test release of [this sandbox post](https://codegolf.codidact.com/posts/283231). If this challenge is well-received, then this quote box will be deleted, officially stating that the challenge can stay.
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- - The string can only contain `+`, `-`, `*`, `/`, `^`, `!` (or a different character; `!` is used here for demonstration), `(`, and `)`.
- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `!` or a different character (I'm using `!` for demonstration) is for assigning positive integers if we want to add positive integers together, or to simply separate positive integers from each other.
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-4 * 2` which returns `-6`.
- - `++(----//+++++!!!**)` is `2(-4 / 2 + 5 + 3 * 2)` which returns `18`.
- - `--^^^` is `-2 ^ 3` which returns `-8`.
- - An empty input or `()` is `0` which returns `0`.
- - `(+-)/(+-)` is `1 / 1 (1 - 1)` is `undefined`, but fr the sake of this challenge, it returns `0`.
- # Error Handling
- Everything in this section is [undefined behavior](https://codegolf.codidact.com/comments/thread/3915#comment-12400). Please DON'T do these when inputting.
- - A character that's not supposed to be there.
- - A beginner number is assigned NOT by `+`, `-`, `!` (or a different character), or `(`.
- - An open parentheses doesn't have a paired closed parentheses.
- - A whitespace character in the string (tabs, spaces, etc.).
- - Characters that aren't part of the English alphabet. `ñ`, `る` and `θ` are examples.
- - An equation like `!/(+-)` or `1 / 1(1-1)` leads to the division by zero error. Refrain from doing such equations in the input.
- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
#6: Post edited
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- The string can only contain `+`, `-`, `*`, `/`, `^`, `!` (or something else), `(`, and `)`.- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `!` or a different character (I'm using `!` for demonstration) is for assigning positive integers if we want to add positive integers together, or to simply separate positive integers from each other.
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-4 * 2` which returns `-6`.
- - `++(----//+++++!!!**)` is `2(-4 / 2 + 5 + 3 * 2)` which returns `18`.
- - `--^^^` is `-2 ^ 3` which returns `-8`.
- - An empty input is `0` which returns `0`.
- # Error Handling
- Everything in this section is [undefined behavior](https://codegolf.codidact.com/comments/thread/3915#comment-12400). Please DON'T do these when inputting.
- - A character that's not supposed to be there.
- - A beginner number is assigned NOT by `+`, `-`, `!` (or a different character), or `(`.
- - An open parentheses doesn't have a paired closed parentheses.
- A whitespace character (tabs, spaces, etc.).- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- - The string can only contain `+`, `-`, `*`, `/`, `^`, `!` (or a different character; `!` is used here for demonstration), `(`, and `)`.
- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `!` or a different character (I'm using `!` for demonstration) is for assigning positive integers if we want to add positive integers together, or to simply separate positive integers from each other.
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-4 * 2` which returns `-6`.
- - `++(----//+++++!!!**)` is `2(-4 / 2 + 5 + 3 * 2)` which returns `18`.
- - `--^^^` is `-2 ^ 3` which returns `-8`.
- - An empty input is `0` which returns `0`.
- # Error Handling
- Everything in this section is [undefined behavior](https://codegolf.codidact.com/comments/thread/3915#comment-12400). Please DON'T do these when inputting.
- - A character that's not supposed to be there.
- - A beginner number is assigned NOT by `+`, `-`, `!` (or a different character), or `(`.
- - An open parentheses doesn't have a paired closed parentheses.
- - A whitespace character in the string (tabs, spaces, etc.).
- - Characters that aren't part of the English alphabet. `ñ`, `る` and `θ` are examples.
- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
#5: Post edited
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- - The string can only contain `+`, `-`, `*`, `/`, `^`, `!` (or something else), `(`, and `)`.
- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `!` or a different character (I'm using `!` for demonstration) is for assigning positive integers if we want to add positive integers together, or to simply separate positive integers from each other.
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-4 * 2` which returns `-6`.
- - `++(----//+++++!!!**)` is `2(-4 / 2 + 5 + 3 * 2)` which returns `18`.
- - `--^^^` is `-2 ^ 3` which returns `-8`.
- - An empty input is `0` which returns `0`.
- # Error Handling
Return a string to signify that the equation is invalid when:- A character that's not supposed to be in the input is in the input.- A beginner number is assigned NOT by `+`, `-`, `!`, or `(`.- - An open parentheses doesn't have a paired closed parentheses.
- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- - The string can only contain `+`, `-`, `*`, `/`, `^`, `!` (or something else), `(`, and `)`.
- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `!` or a different character (I'm using `!` for demonstration) is for assigning positive integers if we want to add positive integers together, or to simply separate positive integers from each other.
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-4 * 2` which returns `-6`.
- - `++(----//+++++!!!**)` is `2(-4 / 2 + 5 + 3 * 2)` which returns `18`.
- - `--^^^` is `-2 ^ 3` which returns `-8`.
- - An empty input is `0` which returns `0`.
- # Error Handling
- Everything in this section is [undefined behavior](https://codegolf.codidact.com/comments/thread/3915#comment-12400). Please DON'T do these when inputting.
- - A character that's not supposed to be there.
- - A beginner number is assigned NOT by `+`, `-`, `!` (or a different character), or `(`.
- - An open parentheses doesn't have a paired closed parentheses.
- - A whitespace character (tabs, spaces, etc.).
- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
#4: Post edited
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- - The string can only contain `+`, `-`, `*`, `/`, `^`, `!` (or something else), `(`, and `)`.
- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `!` or a different character (I'm using `!` for demonstration) is for assigning positive integers if we want to add positive integers together, or to simply separate positive integers from each other.
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-4 * 2` which returns `-6`.
- - `++(----//+++++!!!**)` is `2(-4 / 2 + 5 + 3 * 2)` which returns `18`.
- - `--^^^` is `-2 ^ 3` which returns `-8`.
- - An empty input is `0` which returns `0`.
- # Error Handling
- Return a string to signify that the equation is invalid when:
- - A character that's not supposed to be in the input is in the input.
- A beginner number is assigned NOT by `+`, `-`, or `(`.- - An open parentheses doesn't have a paired closed parentheses.
- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- - The string can only contain `+`, `-`, `*`, `/`, `^`, `!` (or something else), `(`, and `)`.
- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `!` or a different character (I'm using `!` for demonstration) is for assigning positive integers if we want to add positive integers together, or to simply separate positive integers from each other.
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-4 * 2` which returns `-6`.
- - `++(----//+++++!!!**)` is `2(-4 / 2 + 5 + 3 * 2)` which returns `18`.
- - `--^^^` is `-2 ^ 3` which returns `-8`.
- - An empty input is `0` which returns `0`.
- # Error Handling
- Return a string to signify that the equation is invalid when:
- - A character that's not supposed to be in the input is in the input.
- - A beginner number is assigned NOT by `+`, `-`, `!`, or `(`.
- - An open parentheses doesn't have a paired closed parentheses.
- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
#3: Post edited
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- The string can only contain `+`, `-`, `*`, `/`, `^`, `(`, and `)`.- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-4 * 2` which returns `-6`.
- `++(----//+++++++**)` is `2(-4 / 2 + 7 * 2)` which returns `24`.- - `--^^^` is `-2 ^ 3` which returns `-8`.
- - An empty input is `0` which returns `0`.
- # Error Handling
- Return a string to signify that the equation is invalid when:
- - A character that's not supposed to be in the input is in the input.
- - A beginner number is assigned NOT by `+`, `-`, or `(`.
- - An open parentheses doesn't have a paired closed parentheses.
- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- - The string can only contain `+`, `-`, `*`, `/`, `^`, `!` (or something else), `(`, and `)`.
- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `!` or a different character (I'm using `!` for demonstration) is for assigning positive integers if we want to add positive integers together, or to simply separate positive integers from each other.
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-4 * 2` which returns `-6`.
- - `++(----//+++++!!!**)` is `2(-4 / 2 + 5 + 3 * 2)` which returns `18`.
- - `--^^^` is `-2 ^ 3` which returns `-8`.
- - An empty input is `0` which returns `0`.
- # Error Handling
- Return a string to signify that the equation is invalid when:
- - A character that's not supposed to be in the input is in the input.
- - A beginner number is assigned NOT by `+`, `-`, or `(`.
- - An open parentheses doesn't have a paired closed parentheses.
- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
#2: Post edited
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- - The string can only contain `+`, `-`, `*`, `/`, `^`, `(`, and `)`.
- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-4 * 2` which returns `-6`.
- - `++(----//+++++++**)` is `2(-4 / 2 + 7 * 2)` which returns `24`.
- `--^^^` is `2 ^ 3` which returns `-8`.- - An empty input is `0` which returns `0`.
- # Error Handling
- Return a string to signify that the equation is invalid when:
- - A character that's not supposed to be in the input is in the input.
- - A beginner number is assigned NOT by `+`, `-`, or `(`.
- - An open parentheses doesn't have a paired closed parentheses.
- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
- # Challenge
- Create a program that takes input of a string and outputs an integer using the following calculation system:
- - The string can only contain `+`, `-`, `*`, `/`, `^`, `(`, and `)`.
- - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`.
- - Here are the operations of each symbol:
- - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`)
- - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`)
- - - `*` is multiplication. (`**` = `* 2`)
- - - `/` is division. (`//////` = `/ 6`)
- - - `^` is exponentiation/ (`^^^` = `^ 3`)
- - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`)
- - The output must be an integer, being the result of the whole equation.
- - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction).
- - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins.
- # Testcases
- - `+++++` is `+ 5` which returns `5`.
- - `---**` is `-4 * 2` which returns `-6`.
- - `++(----//+++++++**)` is `2(-4 / 2 + 7 * 2)` which returns `24`.
- - `--^^^` is `-2 ^ 3` which returns `-8`.
- - An empty input is `0` which returns `0`.
- # Error Handling
- Return a string to signify that the equation is invalid when:
- - A character that's not supposed to be in the input is in the input.
- - A beginner number is assigned NOT by `+`, `-`, or `(`.
- - An open parentheses doesn't have a paired closed parentheses.
- # Suggestions
- - Any way to improve this?
- - Anything unclear?
- - Are these the right tags?
- - Any more errors to handle?
#1: Initial revision
A chunk of symbols is a calculation
# Challenge Create a program that takes input of a string and outputs an integer using the following calculation system: - The string can only contain `+`, `-`, `*`, `/`, `^`, `(`, and `)`. - In this system, a character shows the value of $1$. This demonstrates the value of an integer with the system. Examples are `+++++`, which is equal to `+ 5`, and `***`, which is `* 3`. - Here are the operations of each symbol: - - `+` is addition and for assigning a beginning positive integer. (`+++++++++` = `+ 9`) - - `-` is subtraction and for assigning a beginning negative integer. (`-------------` = `-13`/`- 13`) - - `*` is multiplication. (`**` = `* 2`) - - `/` is division. (`//////` = `/ 6`) - - `^` is exponentiation/ (`^^^` = `^ 3`) - - `(` and `)` are for grouping calculations, and can also be used for multiplying a number into an equation. The only way to interact with the grouped equations is if no numbers precede them. `!!!+++++(----***)//` = `3 + 4(-4 * 3) / 2`) - The output must be an integer, being the result of the whole equation. - The whole system should follow GEMDAS (Grouping (Parentheses), Exponentiation, Multiplication/Division, Addition/Subtraction). - Being a <a class="badge is-tag">code-golf</a> challenge, the shortest program of each language wins. # Testcases - `+++++` is `+ 5` which returns `5`. - `---**` is `-4 * 2` which returns `-6`. - `++(----//+++++++**)` is `2(-4 / 2 + 7 * 2)` which returns `24`. - `--^^^` is `2 ^ 3` which returns `-8`. - An empty input is `0` which returns `0`. # Error Handling Return a string to signify that the equation is invalid when: - A character that's not supposed to be in the input is in the input. - A beginner number is assigned NOT by `+`, `-`, or `(`. - An open parentheses doesn't have a paired closed parentheses. # Suggestions - Any way to improve this? - Anything unclear? - Are these the right tags? - Any more errors to handle?