Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Sandbox

Post History

50%
+0 −0
Sandbox Single character Roman numeral [FINALIZED]

posted 7mo ago by trichoplax‭  ·  edited 7mo ago by trichoplax‭

#3: Post edited by user avatar trichoplax‭ · 2023-10-13T03:28:52Z (7 months ago)
Mark as finalized
  • 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 by user avatar trichoplax‭ · 2023-10-12T00:48:46Z (7 months ago)
Right align numbers in table
  • 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 by user avatar trichoplax‭ · 2023-10-11T19:23:05Z (7 months ago)
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"