Post History
#3: Post edited
Single character Roman numeral
- Single character Roman numeral [FINALIZED]
- Given a single character, which is a valid Roman numeral, output its value.
- ## Values
- There are 7 valid single character Roman numerals, with the following values:
- Character | Value
- --------- | ----:
- I | 1
- V | 5
- X | 10
- L | 50
- C | 100
- D | 500
- M | 1000
- ## Input
- - A single character, which will always be one of `IVXLCDM`.
- ## Output
- - The corresponding value.
- ## Test cases
- As there are only 7 valid inputs, the list of test cases is exhaustive.
- Test cases are in the format `"input" : output`.
- ```text
- "I" : 1
- "V" : 5
- "X" : 10
- "L" : 50
- "C" : 100
- "D" : 500
- "M" : 1000
- ```
- ## Scoring
- This is a [code golf challenge]. Your score is the number of bytes in your code.
- > Explanations are optional, but I'm more likely to upvote answers that have one.
- [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
- ## Now posted: [Single digit Roman numeral](https://codegolf.codidact.com/posts/289996)
- Given a single character, which is a valid Roman numeral, output its value.
- ## Values
- There are 7 valid single character Roman numerals, with the following values:
- Character | Value
- --------- | ----:
- I | 1
- V | 5
- X | 10
- L | 50
- C | 100
- D | 500
- M | 1000
- ## Input
- - A single character, which will always be one of `IVXLCDM`.
- ## Output
- - The corresponding value.
- ## Test cases
- As there are only 7 valid inputs, the list of test cases is exhaustive.
- Test cases are in the format `"input" : output`.
- ```text
- "I" : 1
- "V" : 5
- "X" : 10
- "L" : 50
- "C" : 100
- "D" : 500
- "M" : 1000
- ```
- ## Scoring
- This is a [code golf challenge]. Your score is the number of bytes in your code.
- > Explanations are optional, but I'm more likely to upvote answers that have one.
- [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#2: Post edited
- Given a single character, which is a valid Roman numeral, output its value.
- ## Values
- There are 7 valid single character Roman numerals, with the following values:
- Character | Value
- ---------- | -----
- I | 1
- V | 5
- X | 10
- L | 50
- C | 100
- D | 500
- M | 1000
- ## Input
- - A single character, which will always be one of `IVXLCDM`.
- ## Output
- - The corresponding value.
- ## Test cases
- As there are only 7 valid inputs, the list of test cases is exhaustive.
- Test cases are in the format `"input" : output`.
- ```text
- "I" : 1
- "V" : 5
- "X" : 10
- "L" : 50
- "C" : 100
- "D" : 500
- "M" : 1000
- ```
- ## Scoring
- This is a [code golf challenge]. Your score is the number of bytes in your code.
- > Explanations are optional, but I'm more likely to upvote answers that have one.
- [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
- Given a single character, which is a valid Roman numeral, output its value.
- ## Values
- There are 7 valid single character Roman numerals, with the following values:
- Character | Value
- ---------- | -----
- --------- | ----:
- I | 1
- V | 5
- X | 10
- L | 50
- C | 100
- D | 500
- M | 1000
- ## Input
- - A single character, which will always be one of `IVXLCDM`.
- ## Output
- - The corresponding value.
- ## Test cases
- As there are only 7 valid inputs, the list of test cases is exhaustive.
- Test cases are in the format `"input" : output`.
- ```text
- "I" : 1
- "V" : 5
- "X" : 10
- "L" : 50
- "C" : 100
- "D" : 500
- "M" : 1000
- ```
- ## Scoring
- This is a [code golf challenge]. Your score is the number of bytes in your code.
- > Explanations are optional, but I'm more likely to upvote answers that have one.
- [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"
#1: Initial revision
Single character Roman numeral
Given a single character, which is a valid Roman numeral, output its value. ## Values There are 7 valid single character Roman numerals, with the following values: Character | Value --------- | ----- I | 1 V | 5 X | 10 L | 50 C | 100 D | 500 M | 1000 ## Input - A single character, which will always be one of `IVXLCDM`. ## Output - The corresponding value. ## Test cases As there are only 7 valid inputs, the list of test cases is exhaustive. Test cases are in the format `"input" : output`. ```text "I" : 1 "V" : 5 "X" : 10 "L" : 50 "C" : 100 "D" : 500 "M" : 1000 ``` ## Scoring This is a [code golf challenge]. Your score is the number of bytes in your code. > Explanations are optional, but I'm more likely to upvote answers that have one. [code golf challenge]: https://codegolf.codidact.com/categories/49/tags/4274 "The code-golf tag"