LogoLogo
1.0.0
  • Home
  • Install
  • Docs
  • Contribute
  • Journey
  • Welcome
  • The Varphi Language Standard
    • Welcome
    • State Names
    • Tallies and Blanks
    • Head Directions
    • Lines
    • Comments
    • Varphi Programs
    • Addressing Ambiguities
  • Writing Varphi Programs
    • Your First Varphi Program
    • Running Varphi Programs
    • Debugging Varphi Programs
    • The Varphi VS Code Extension
    • Good Practices
    • More Examples
      • Addition By One
      • Add Two Numbers
      • Multiplication By Two
      • Rock, Paper, Scissors
      • Coin Flip
  • Turing Machine Theory
    • The Unary Number System
    • Turing Machine Tapes
    • Turing Machine Heads
    • Turing Machine States
    • Turing Machines
    • Nondeterministic Turing Machines
Powered by GitBook
LogoLogo

© 2025 Hassan El-Sheikha

On this page
  • Inline Comments
  • Block Comments

Was this helpful?

Edit on GitHub
Export as PDF
  1. The Varphi Language Standard

Comments

Comments enhance code readability by providing explanations and context. They can also be used to temporarily disable code when testing alternate code.

Varphi conveniently uses C-style comments. There are two types of comments in Varphi:

  1. Inline (single-line) comments

  2. Block (multi-line) comments

Inline Comments

An inline comment begins with //. Any text following // on the same line is ignored by the compiler and does not affect execution.

Inline comments can appear on lines of a source file by themselves:

// This is a comment!

Inline comments can also appear at the end of a Varphi line:

q0 1 q0 1 R // If a tally is encountered while on state q0, skip it...

Block Comments

A block comment begins with /* and ends with */. Any text enclosed within these markers is ignored by the compiler. Block comments are useful for providing detailed explanations spanning multiple lines.

Here's an example of a block comment spanning multiple lines:

/* 
State q0:
- Skip all cells with tallies
- When the first blank tape cell is reached, put a tally there and halt
*/
q0 1 q0 1 R
q0 0 q1 1 L

PreviousLinesNextVarphi Programs

Last updated 4 months ago

Was this helpful?