User Tools

Site Tools


crpl:overview

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
crpl:overview [2020/05/27 11:01] – [Notepad++] spelling error Saniancrpl:overview [2023/10/18 15:50] (current) – adding notepad disclaimer Bob
Line 3: Line 3:
  
 ====== CRPL - The Language ====== ====== CRPL - The Language ======
-CRPL (**<color blue>C</color>**reeper **<color blue>R</color>**everse **<color blue>P</color>**olish **<color blue>L</color>**anguage) is a stack-based, Reverse Polish Notation language. There, now that we've said it, what does it mean?+CRPL (**<color orange>C</color>**reeper **<color orange>R</color>**everse **<color orange>P</color>**olish **<color orange>L</color>**anguage) is a stack-based, Reverse Polish Notation language. There, now that we've said it, what does it mean?
  
-CRPL programming is similar to programming a HP calculator or Forth language programming. If this is not something you have done, read on for a brief introduction to CRPL and stack-based programming. <note>For a more detailed CRPL explanation, see the [[crpl:crpltutorial|Tutorial]].</note>+CRPL programming is similar to programming a HP calculator or Forth language programming. If this is not something you have done, read on for a brief introduction to CRPL and stack-based programming. <WRAP info>For a more detailed CRPL explanation, see the [[crpl:crpltutorial|Tutorial]].</WRAP>
  
 Each CRPL instruction (term) uses one or more arguments that are on a "stack". The most recent argument on the stack will be used first. This is called LIFO (**L**ast **I**n, **F**irst **O**ut). In return, the instruction may also place new arguments on the stack as part of its output. These new arguments are first in line to be consumed by the next instruction to be executed. Each CRPL instruction (term) uses one or more arguments that are on a "stack". The most recent argument on the stack will be used first. This is called LIFO (**L**ast **I**n, **F**irst **O**ut). In return, the instruction may also place new arguments on the stack as part of its output. These new arguments are first in line to be consumed by the next instruction to be executed.
Line 20: Line 20:
 <code>2 9</code> <code>2 9</code>
  
-<note> +<WRAP info>You can find more commands and detailed explanations of them in the [[crpl:crplreference|CRPL Reference]]!</WRAP>
-You can find more commands and detailed explanations of them in the [[crpl:crplreference|CRPL Reference]]! +
-</note>+
  
 ===== Comments ===== ===== Comments =====
Line 158: Line 156:
 Any text editor can be used to edit CRPL files. However, syntax highlight and auto completion support files are provided for several available editors. Any text editor can be used to edit CRPL files. However, syntax highlight and auto completion support files are provided for several available editors.
  
-<note>See how others created their maps! You can extract the CRPL scripts and custom images from any CW3 game file. The guide to [[examine map resources]] will show you how to retrieve these resources from other maps.</note>+<WRAP info>See how others created their maps! You can extract the CRPL scripts and custom images from any CW3 game file. The guide to [[examine map resources]] will show you how to retrieve these resources from other maps.</WRAP>
  
 ==== Notepad++ ==== ==== Notepad++ ====
  
-Notepad++ can be obtained from here: [[http://notepad-plus-plus.org/]] +Notepad++ can be obtained from here: [[https://notepad-plus-plus.org/]] 
 +<note>Make sure you download only from the official Notepad++ website to avoid malware. https://notepad-plus-plus.org/</note>
   * Once Notepad++ is installed you can add **syntax highlight** for the CRPL language. Currently there are two sample thems, one for the "normal (llisth) theme and one for the "dark" (Deep Black) theme.    * Once Notepad++ is installed you can add **syntax highlight** for the CRPL language. Currently there are two sample thems, one for the "normal (llisth) theme and one for the "dark" (Deep Black) theme. 
       * Light theme: [[crpl:crpl-syntax|crpl-syntax.xml]]       * Light theme: [[crpl:crpl-syntax|crpl-syntax.xml]]
Line 210: Line 208:
   * All files with the *.crpl extension should now use this package.   * All files with the *.crpl extension should now use this package.
  
-=====Translation Front-end =====+=====Translation Front-ends =====
  
-Forum user [[https://knucklecracker.com/forums/index.php?action=profile;u=6122 | Arin112]] (Discord: Arin112#8343) wrote a C-lookalike front-end translator that will produce xRPL code as output. +  * Forum user [[https://knucklecracker.com/forums/index.php?action=profile;u=6122 | Arin112]] (Discord: Arin112#8343) wrote a C-lookalike front-end translator that will produce xRPL code as output. There is a [[https://knucklecracker.com/forums/index.php?topic=31849.msg179146#msg179146 | reference to the translator (MplLang) on the forum]].  The source code and examples are on [[https://github.com/Arin112/mplLang |  Github]].
  
-There is [[https://knucklecracker.com/forums/index.php?topic=31849.msg179146#msg179146 | reference to the translator (MplLang) on the forum]] , and the source code and examples are on [[https://github.com/Arin112/mplLang |  Github]]. +  * Discord user Redcrafter#7494 wrote transpiler that translates Javascript to xRPL codeThe source code and examples are on [[https://github.com/Redcrafter/crplJs |  Github]].
  
 Time permitting, this deserves a more complete treatment and probably a section of it's own.  Time permitting, this deserves a more complete treatment and probably a section of it's own. 
Line 220: Line 218:
 \\ \\
 \\ \\
-FIXME / DELETEME  + 
 =====Syntax Highlighting in the Wiki =====   =====Syntax Highlighting in the Wiki =====  
     
 Dokuwiki uses [[http://qbnz.com/highlighter/|GeSHi]] syntax highlighting. Dokuwiki uses [[http://qbnz.com/highlighter/|GeSHi]] syntax highlighting.
 +
 +Code examples can be highlighted using the `4rpl` code tag eg:
 +
 +<code 4rpl>
 +# --Volcano-- 5/13/2020 12:58:29 PM
 +
 +$$POSX:154
 +$$POSZ:98
 +$$AMT:100
 +
 +if (GetGameUpdateCount 3600 % eq0)
 + true ->erupting
 +endif
 +
 +if (<-erupting)
 + @Erupt
 +endif
 +
 +if (<-orbsHaveErupted ! GetUnitCount("sniper") 21 gte &&)
 + 240 ->orbsErupting
 + true ->orbsHaveErupted
 +endif
 +
 +if (<-orbsErupting)
 + @OrbsErupt
 +endif
 +
 +:Erupt
 + if (<-eruptCount 60 % eq0)
 + do(2 -1)
 + do(2 -1)
 + AddCreeper(<-POSX I + <-POSZ J + <-AMT)
 + loop
 + loop
 + endif
 + <-eruptCount 1 + ->eruptCount
 + if (<-eruptCount 400 gte)
 + false ->erupting
 + 0 ->eruptCount
 + endif
 +
 +:OrbsErupt
 + V3(RandFloat 0.5 - 1 * 2 RandFloat 0.5 - 1 *) ->orbInitData{"velocity"}
 + CreateOrb(V3(154 randint(-1 2) + 15 98 randint(-1 2) +) <-orbInitData)
 + <-orbsErupting 1 - ->orbsErupting
 +
 +:once
 + Table( "payload" 500 
 + "bounce" true 
 + "creeperdamps" false 
 + "destroywhenstill" false 
 + "destroywhendrytime" 60 
 + "releaseondestroy" false) ->orbInitData
 +</code>
 +
crpl/overview.1590591677.txt.gz · Last modified: 2020/05/27 11:01 by Sanian