marqdo

04-branchok

structure/04-branch.mq.md

Structure

fn · h1main
comment

斜体行是程序语句。分支用 +;臂头单独一行 * 表示 else。

bind`x` = 0
branch
arm`x` > 0
call> print text=正数
arm`x` < 0
call> print text=负数
armelse
call> print text=零

Execution

Source

---
title: 分支
description: `+` 臂;整行 `*` 为 else
---

# main

斜体行是程序语句。分支用 `+`;臂头单独一行 `*` 表示 else。

*`x` = 0*

+ `x` > 0
  > print text=正数
+ `x` < 0
  > print text=负数
+ *
  > print text=零