Map conditional code into a decision tree

Coding agentKINDA1 method

KINDA — AI can help, with a person in the loop.

1 method on the page: 1 prompt.

Use cases

Methods

Paste into a general LLM and map conditional code into a decision tree with execution traces and refactoring opportu…

prompt

LLMPrompt

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>>>