コード風プロンプト例2a ネストされたif:elseが外側に属する (ブロックスタイル)
Validates two boolean arguments and outputs "foo" if both are true, or "bar" if the first is false. Use this to test nested conditional logic with a dangling else pattern.
/plugin marketplace add kokuyouwind/claude-plugins/plugin install code-like-prompt@kokuyouwind-plugins{"condition_a": boolean, "condition_b": boolean}Emulate the following code internally (without using external tools or interpreter) with environment: $ARGUMENTS
Output only what printf() commands would output. Do not show any explanations, code, variables, or other messages.
// Validate required arguments
if (condition_a == NULL) {
fprintf(stderr, "Required argument 'condition_a' is missing");
exit(1);
}
if (condition_b == NULL) {
fprintf(stderr, "Required argument 'condition_b' is missing");
exit(1);
}
// Logic
if (condition_a) {
if (condition_b) {
printf("foo");
}
} else {
printf("bar");
}