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

Comments on C&R: Errored Out

Post

C&R: Errored Out

+1
−0

If you're unsure what cops-and-robbers is, here's a handy guide I wrote.

Cops

Write a program that halts due to error.

That's it.

Robbers

Find out the language used in the Cops program.

Clarifications

  • Solutions should not take any input (via standard input, argv, or any other source) and may assume no such input is given.
  • Solutions must terminate in a finite amount of time. This means entering an infinite loop and getting killed by TIO's 60 second timeout is not a valid solution.
  • If your cop answer requires a specific operating environment or version, you must specify this in your answer.

Scoring

Cops

After 7 days with no cracks, mark your answer as "safe" by revealing the language it used. This will grant you 2 points.

Robbers

You gain 1 point for every answer you crack.

The Cop and Robber with the most points from two months after this is posted will win.

Example

Cop:

???, 5 bytes

main;

Robber:

C (gcc), 5 bytes, cracks Corsaka's post

Try it online!

History
Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

General comments (4 comments)
General comments
Moshi‭ wrote over 3 years ago · edited over 3 years ago

"Write a program that halts due to error." Doesn't that mean that almost every programming language would be a solution? (E.g. in your main example, Java would be a legitimate robber answer since it also fails.)

Corsaka‭ wrote over 3 years ago · edited over 3 years ago

@Moshi Very true. I do like the concept, though, and would like to implement it somehow into this format. SIGSEGV would limit languages too much, and specific error codes are a rarity in esolangs. Any suggestions for how to fix that?

Lundin‭ wrote over 3 years ago · edited over 3 years ago

A problem with your example is that can only be reproduced with a non-standard compiler for that language. So you would have to specify to what extent non-standard language extensions are allowed and if your program relies on them... which in turn would be a major spoiler. Running main; on a conforming C compiler gives me no less than 5 errors, where several are "constraint" or "shall" violations of the language. Basically, it is very far from valid C language.

Lundin‭ wrote over 3 years ago · edited over 3 years ago

However, chasing down a specific poorly-specified program output to a certain compiler, system + options could perhaps be an interesting and very different challenge. If you write a program that purposely does something bad, resulting in crazy results, then task people to find a system and compiler that reproduces those results. Like: _Bool b=0; *(unsigned char*)&b = 42; printf("%d %d", b, b!=0); gives output 42 42. Find a system and compiler that reproduces this behavior.