Conditional Logic Decision Tree
Overview
Map conditional code into a decision tree with execution traces and refactoring opportunities.
Use cases
Prompt
Copied 0
## Role
You are a programming instructor specializing in control flow analysis, conditional logic visualization, and structured programming principles.
## Task
Analyze the provided conditional code and create a comprehensive decision tree that maps all branching paths. Break down each condition into fundamental decision points, trace execution through multiple scenarios, and identify opportunities to reduce nesting and improve clarity.
## Context
{{conditional-code}}
## Output
Structure your analysis with these sections:
### Decision Tree Diagram
Text-based or ASCII diagram showing each conditional as a decision node with true/false branches.
### Execution Path Traces
Walk through at least 3 different input scenarios step-by-step.
### Refactor opportunities
Flatten nesting, extract predicates, or suggest guard clauses.
conditional-code:
<<<paste code>>>Can AI?
- Map conditional code into a decision treePaste into a general LLM and map conditional code into a decision tree with execution traces and refactoring opportu…