Both flowchart and pseudocode are popular tools to describe program algorithms. However, they have their strengths as well as weaknesses. Flowchart visualizes logic flow effectively but sometimes it may not be conveniently converted to program code for novice programmers. On the other hand, pseudocode format is closer to program code but may not be as easily visualized as flow chart. To address the issue, this paper proposes an alternative graphical representation of logic flow, called ball-maze block diagram, which takes advantages of both flowchart and pseudocode in a single representation format. Besides describing the graphical representation of the diagram, this paper also demonstrates systematic conversion from the diagram to standard code structure to ease code development. The generated code is structure-friendly regardless of the complexity of logic flow. Step-by-step guides are given on practical problem to demonstrate the usefulness of the proposed methods.