Author: Tristano Ajmone

# Highlight Examples

Tristano Ajmone
tajmone@gmail.com
version 1.0.2, 2019-04-13

## Alan Interactive Fiction

    --==============================================================================
    -- "Chez Alan" by Tristano Ajmone, 2018 || Public domain: http://unlicense.org
    --==============================================================================
    Import 'library.i'. --> ALAN Standard Library v2.1

    The my_game IsA definition_block
      Has title    "Chez Alan".
      Has subtitle "A small demo adventure".
      Has author   "Tristano Ajmone".
      Has year     2018.
      Has version  "1".
    End The.

    The 'IF Plaza' IsA location
      Exit north to ChezAlan.
      Description "North lies ""Chez Alan"", the renown French brasserie."
    End The 'IF Plaza'.

    The ChezAlan IsA room.
      Name 'Chez Alan Brasserie'.
      Description
        "Today Chez Alan seems busier then ever."
      Entered
        """Welcome back Sir!"" the maitre greets you.
        $nHe has a strong French accent."
    End The ChezAlan.

    The Pierre IsA male At ChezAlan.
      Name Pierre.
      Name 'Alan''s' brother.
      Is named.
      Has ex "Pierre is Alan's brother.".
    End The Pierre.

    Start At 'IF Plaza'.
    Describe banner.

language: | Alan IF 3
langDef: | `alan.lang` by Tristano Ajmone

## EXAPUNKS

    NOTE TECH REDSHIFT DK
    LINK 800
    COPY 999 T
    MARK BRUTEFORCE
    @REP 3
    SWIZ T @{3,-1} #PASS
    @END
    SUBI T 1 T
    REPL CANARY
    COPY T X ; TMP STORE T
    TEST MRD ; IS XB INSIDE?
    TJMP HACKED
    COPY X T ; RETRIEVE T
    TJMP BRUTEFORCE
    MARK HACKED
    VOID M ; SIGN.ALIVE
    MAKE
    ADDI X 1 X
    NOTE STORE PASSWORD:
    @REP 3
    SWIZ X @{3,-1} F
    @END
    COPY M F ; GET RDK ID
    LINK -1
    HALT

    MARK CANARY
    LINK 800 ; DIE IF LOCKED
    COPY 666 M ; SIGN.ALIVE
    GRAB 199
    COPY F M ; SEND RDK ID
    HALT

language: | EXAPUNKS
langDef: | `exapunks.lang` by Tristano Ajmone

## PureBasic

     1 ; ==============================================================================
     2 ;                   PureBasic 5.62 - Syntax Highlighting Test
     3 ; ==============================================================================
     4 ; by Tristano Ajmone (2018/10/04), public domain: http://unlicense.org
     5
     6 Declare.i CountdownDialog(text.s)
     7
     8 Macro IsEven(num)
     9   (num & 1 = 0)
    10 EndMacro
    11
    12 For i=5 To 1 Step -1
    13   If isEven(i) : Debug Str(i) +" is even." : EndIf
    14   TEXT$ = "Iteration number: " + Str(i) + ~"\n\nDo you wish to continue?"
    15   If CountdownDialog(TEXT$) : Break : EndIf
    16 Next
    17
    18 MyVar = %1011 << 1
    19 EnableASM
    20 INC MyVar ; Mix ASM keywords with PureBasic variable
    21 DisableASM
    22 Debug "MyVar: "+Str(MyVar)
    23
    24 Procedure.i CountdownDialog(text.s)
    25   UserChoice = MessageRequester("Countdown Dialog", text, #PB_MessageRequester_YesNo |
    26                                                           #PB_MessageRequester_Info)
    27   If UserChoice = #PB_MessageRequester_No
    28     CompilerIf #PB_Compiler_Processor = #PB_Processor_x64
    29       !mov rax,1
    30     CompilerElse
    31       !mov eax,1
    32     CompilerEndIf
    33   Else
    34     ProcedureReturn 0
    35   EndIf
    36   ProcedureReturn ; RAX/EAX will be the implicit return value
    37 EndProcedure

language: | PureBasic
langDef: | `purebasic.lang` by Tristano Ajmone