Iván Coellito Riverita
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Nairb A Brainfuck derivate. ## Regular Commands There are 7 commands that have a numeric argument. |Command|Action | |:-----:|:----------| |`+` |Add _x_ to current cell. |`-` |Decrement by _x_ current cell. |`=` |Set current cell's value to _x_. |`<` |Move the pointer _x_ steps to the left. |`>` |Move the pointer _x_ steps to the right. |`.` |Print _x_ (ASCII value) |`:` |Print _x_ (Numeric value) So `:5` will print 5. Anyway, the numeric argument is optional. In `+`, `-`, `<` and `>` the default is 1, so they'll work like BF. In `=` default argument value is 0. In `.` it's current cell value. :::success **Examples:** `+++` = [3] `++>+` = [2, 1] `+3=+6` = [6] `+>5+++` = [1, 0, 0, 0, 0, 3] `.72` = H `+++++=` = [0] ::: These numeric values are expressions, we'll see them later. There's also a command that doesn't have a numeric argument: `,`. This makes user input and stores it in the current cell. :::warning **Tip:** `'` is commonly referred as the current cell value. **Tip 2:** Use `/this/` syntax to make comments. ::: ---- ### Regular commands |Command|Action |Default _x_ value |:-----:|:----------|--------------- |`+` |Add _x_ to current cell.|`1` |`-` |Decrease by _x_ current cell.|`1` |`=` |Set current cell's value to _x_.|`0` |`<` |Move the pointer _x_ steps to the left.|`1` |`>` |Move the pointer _x_ steps to the right.|`1` |`.` |Print _x_ as a ASCII character|`'` |`:` |Print _x_ as a numeric value.|`'` |`,` |Set current cell to user's input.|<small>None</small> ## Variables You can make a variable using the `&` command. ``` &"(name)"(value) ``` If name is only one character, you can discard the quotes. ``` &a2 /set a to 2/ ``` You can let a variable's value be the current cell's value like this: ``` &a /set a to '/ ``` Use a variable putting its name instead of the number. ``` $a5 /set a to 5/ +3 /add 3 to current cell/ +a /add a to current cell/ : /print current cell/ /This will print 8 (5+3)/ ``` Put the quotes if necessary, too. ``` &"variable" > ="variable": ``` ## Expressions When doing `+5`, `5` is an expression. As we recently seen, variables are available too in expressions (`+a`). But there are more things you can do with expressions. ### Variables Write variable's names with quotes to get them. > `&"hello"5 :"hello"` = 5[color=green] Quotes are unnecessary if variable's name has only one character. > `&a5 :a` = 5[color=green] Final quotes are explicit in expressions. > `&"hello"a :"hello` = 5[color=green] ### Special variables There are more variables to use. These are called special variables. The `'` variable means the current cell's value. You can multiply by 2 with this. >`+25 +' :` = 50 [color=green] The `#` variable means (zero-indexed) the position of the pointer. >`>6 <1 :#` = 5 [color=green] ### Negating numbers You can negate numbers preceding them with `_`. > [color=green]`+_5:` = -5 This also works for variables: > [color=green] `&a5 :_a` = -5 > [color=green] `+9 :_'` = -9 ### Add values directly You can add values directly putting them in the same expression. > [color=green] `&2a :a3` = 5 You can mix negating and adding to make subtraction: > [color=green] `:7_2` = (7 + -2) 5 ## Conditionals Conditionals are used in if (`()`) and while (`[]`) commands. We'll see them now. _if_ runs commands if a condition is true. _while_ runs command until a condition is not true. ### Syntax of _if_ Imagine you want to print "89" if variable _a_ is equal to 89. You have to use an if command. The syntax is: (<exp1><operator><exp2><commands>) * **Exp1** = The first number to compare. * **Operator** = The operator. It can be `<`, `>`, `=`, `!`, `+`, `-`. * Operators will be more detailedly explained later. * **Exp2** = The second number to compare. * **Commands** = The commands to execute if comparation is true. So, to do that, you'll have to do: (a=89 /conditional/ :89 /commands/ ) <small>Which is the same as `(a=89:89)`</small> ### Operators |Operator|Action |:------:|:----- |`=` |_x_ equal to _y_ |`!` |_x_ not equal to _y_ |`<` |_x_ less than _y_ |`+` |_x_ equal or greater than _y_ |`>` |_x_ more than _y_ |`-` |_x_ equal or less than _y_ ### Default arguments First expression default argument is `'`. Second expression default argument is `0`. So, if you do `(= :5)` it will be the same as `('=0 :5)`. ### Optional else You can add an else to an _if_ command with `;;`. ('=0 .110.111 ;; :') <small>Print "no" if `'` is 0, print the number else.</small> ### Syntax of _while_ There's also a while command. It's the same as _if_ command but with brackets (`[]`) instead. ## Repetition The last command is the repetition command. It works like this: {<exp><commands>} * **Exp:** times to repeat _\<commands\>_. (default: 2) * **Commands:** Commands. ::: success Examples: `{3:1}` = 111 `{3 +:}` = 123 `{.72}` = HH ::: ## Hello World .72.101{.108}.111.44.32.87.111.114.108.100.33

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully