Tag Archives: plurps

PLURPS: Programming Language Using Role-Playing Syntax

PLURPS - Programming Language Using Role-Playing Syntax

Just an idea to write code as if we are playing a RPG. Very initial brainstorm.

Terms:
Class - class
New instance - create
Delete instance - kill
If - attack
Then - hit
Else - miss
Function - skill
Parameters - targets
Return - result
Switch - menu
Case - option
Array - group
Add to array - join
Delete from array - leave
For - fight <stat> <value |number>
Next in loop - grind
Increment - up (<stat> up <optional number|default 1>)
Decrement - down (<stat> down <optional number|default 1>)
Break - flee
Continue - skip
Variable - stat
Integer - number
String - quote
Local - melee
Global - ranged
End block - done
True - yes
False - no
Output - say

The following examples may or may not be valid. Only to show what it could or should look like.

Example 1:
say "Hello World"

Example 2:

fight level 0
grind level < enemies.size
   attack goblin > 25
      hit
         enemies[level]
      miss
   done
   attack player.hp <= 0
      hit
        flee
   done
   level up
done