コード風プロンプト例2b ネストされたif:elseが内側に属する (ブロックスタイル)
Tests nested if-else logic with inner else block. Use this to verify how the model handles deeply nested conditional structures in C-style code.
/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");
}
}