Pawn

1 program Added 2025-10-22T15:42:26Z Model: anthropic/claude-4.5-sonnetTemp: 0.4 Evidence Report issue View issues
Aliases: Small, Small-C
Provenance: commit a366a0bd55 · authored 2025-10-22T17:42:26+02:00 · model anthropic/claude-4.5-sonnet

Sources mentioning this language

6 sources · pl_id: pl/pawn
LLM (this repo) · 1PldbLinguistPygmentsHyperpolyglotWikidata · Q1929075

Extensions claimed by this language

10 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.amxwikidataprimary18.5K files
.incwikidataprimary6.3M files
.ppygmentsprimary5.0M files
.pwikidataprimary5.0M files
.pwnlinguistprimary98.6K files
.pwnwikidataprimary98.6K files
.inclinguistsecondary6.3M files
.incpygmentssecondary6.3M files
.pwnpygmentssecondary98.6K files
.smalinguistsecondary46.2K files

Related languages

Small-C (0.35)Small (0.33)Small Basic (0.26)SMALGOL (0.25)SmallBASIC (0.19)

LLM-contributed programs

Simple Calculator with Basic Operations

Provenance: commit a366a0bd55 · authored 2025-10-22T17:42:26+02:00 · model anthropic/claude-4.5-sonnet · Temp 0.4
code.p · license: Apache-2.0 · added: 2025-10-22T15:42:26Z
/* Simple calculator, using the rational number support library
 * (c) Copyright 1998-2011, ITB CompuPhase
 * This file is provided as is (no warranties).
 */

#include <rational>
#include <string>

main()
{
    new buf{100}
    new Rational: a, Rational: b, Rational: result
    new op{2}

    print "Simple calculator\n"
    print "Supported operators: + - * /\n"
    print "Enter expressions like: 3.5 + 2.25\n"
    print "Type 'quit' to exit\n\n"

    for ( ;; )
    {
        print "> "
        getstring buf, sizeof buf
        if (strcmp(buf, "quit") == 0)
            break

        new pos = 0
        new len = strlen(buf)

        /* skip leading whitespace */
        while (pos < len && buf{pos} <= ' ')
            pos++

        /* get first number */
        new start = pos
        while (pos < len && buf{pos} != ' ' && buf{pos} != '\t')
            pos++
        new num1{20}
        strmid(num1, buf, start, pos, sizeof num1)
        a = rationalstr(num1)

        /* skip whitespace */
        while (pos < len && buf{pos} <= ' ')
            pos++

        /* get operator */
        if (pos < len)
            op{0} = buf{pos++}
        else
            op{0} = 0
        op{1} = 0

        /* skip whitespace */
        while (pos < len && buf{pos} <= ' ')
            pos++

        /* get second number */
        start = pos
        while (pos < len && buf{pos} > ' ')
            pos++
        new num2{20}
        strmid(num2, buf, start, pos, sizeof num2)
        b = rationalstr(num2)

        /* perform operation */
        switch (op{0})
        {
            case '+':
                result = a + b
            case '-':
                result = a - b
            case '*':
                result = a * b
            case '/':
            {
                if (b == Rational: 0)
                {
                    print "Error: Division by zero\n"
                    continue
                }
                result = a / b
            }
            default:
            {
                print "Error: Unknown operator\n"
                continue
            }
        }

        /* display result */
        printf "Result: %r\n", result
    }

    print "Goodbye!\n"
}

Real programs from Software Heritage

2 samples mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
effectinfo_ctf.inc · 3686 B · ext .inc · seen 465× in SWH
via fallback
swh:1:cnt:5794ad4773e66b0d7b31460f8b6991f9ea12a1d0;origin=https://github.com/xonotic/xonotic-data.pk3dir;anchor=swh:1:rev:387a1dc59f9c7ad516ad736e91280beecc8fd082;path=/qcsrc/common/effects/effectinfo_ctf.inc
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
// flag_touch -- effects for touching the flag
#define flag_touch(name, colormin, colormax) \
    DEF(name##flag_touch); \
    SUB(name##flag_touch) { \
        MY(airfriction) = 3; \
        MY(alpha_max) = 256; \
        MY(alpha_fade) = 556; \
        MY(bounce) = 1.500000; \
        MY(color_min) = colormin; \
        MY(color_max) = colormax; \
        MY(count) = 35; \
        MY(gravity) = 1; \
        MY(originjitter) = '1.0 1.0 1.0'; \
        MY(size_min) = 1; \
        MY(size_max) = 3; \
        MY(tex_min) = 40; \
        MY(tex_max) = 40; \
        MY(type) = "spark"; \
        MY(velocityjitter) = '300.0 300.0 300.0'; \
        MY(velocitymultiplier) = 0.500000; \
    }

flag_touch(red,     "0xFF0000", "0x970000")
flag_touch(blue,    "0x0000FF", "0x000097")
flag_touch(yellow,  "0xFFFF0F", "0xFFFF0F")
flag_touch(pink,    "0xFF0FFF", "0xFF0FFF")
flag_touch(neutral, "0xFFFFFF", "0xFFFFFF")
#undef flag_touch

#define pass(name, colormin, colormax) \
    DEF(name##_pass); \
    SUB(name##_pass) { \
        MY(airfriction) = 5; \
        MY(alpha_min) = 64; \
        MY(alpha_max) = 128; \
        MY(alpha_fade) = 64; \
        MY(color_min) = colormin; \
        MY(color_max) = colormax; \
        MY(sizeincrease) = 2; \
        MY(size_min) = 2; \
        MY(size_max) = 2; \
        MY(tex_min) = 32; \
        MY(tex_max) = 32; \
        MY(trailspacing) = 64; \
        MY(type) = "static"; \
    } \
    SUB(name##_pass) { \
        MY(airfriction) = 9; \
        MY(alpha_min) = 32; \
        MY(alpha_max) = 64; \
        MY(alpha_fade) = 32; \
        MY(color_min) = colormin; \
        MY(color_max) = colormax; \
        MY(sizeincrease) = 8; \
        MY(size_min) = 1; \
        MY(size_max) = 1; \
        MY(tex_max) = 8; \
        MY(trailspacing) = 12; \
        MY(type) = "static"; \
        MY(velocityjitter) = '64.0 64.0 64.0'; \
    } \
    SUB(name##_pass) { \
        MY(alpha_min) = 256; \
        MY(alpha_max) = 256; \
        MY(alpha_fade) = 1280; \
        MY(color_min) = colormin; \
        MY(color_max) = colormax; \
        MY(size_min) = 4; \
        MY(size_max) = 4; \
        MY(trailspacing) = 12; \
        MY(type) = "static"; \
    } \
    /**/

pass(red,       "0xFF0000", "0x970000")
pass(blue,      "0x0000FF", "0x000097")
pass(yellow,    "0xFFFF0F", "0xFFFF0F")
pass(pink,      "0xFFFFFF", "0xFFFFFF")
pass(neutral,   "0xFFFFFF", "0xFFFFFF")
#undef pass

// cap -- team capture effect
#define cap(name, colormin, colormax) \
    DEF(name##_cap); \
    SUB(name##_cap) { \
        MY(airfriction) = 2; \
        MY(alpha_max) = 256; \
        MY(alpha_fade) = 100; \
        MY(bounce) = 1.500000; \
        MY(color_min) = colormin; \
        MY(color_max) = colormax; \
        MY(count) = 500; \
        MY(originjitter) = '1.0 1.0 1.0'; \
        MY(size_min) = 1; \
        MY(size_max) = 1; \
        MY(stretchfactor) = 0.600000; \
        MY(tex_min) = 64; \
        MY(tex_max) = 64; \
        MY(type) = "spark"; \
        MY(velocityjitter) = '1000.0 1000.0 1500.0'; \
        MY(velocitymultiplier) = 0.500000; \
    } \
    SUB(name##_cap) { \
        MY(alpha_min) = 190; \
        MY(alpha_max) = 190; \
        MY(alpha_fade) = 180; \
        MY(color_min) = colormin; \
        MY(color_max) = colormax; \
        MY(countabsolute) = 1; \
        MY(sizeincrease) = -80; \
        MY(size_min) = 150; \
        MY(size_max) = 150; \
        MY(tex_min) = 65; \
        MY(tex_max) = 65; \
        MY(type) = "smoke"; \
    } \
    /**/

cap(red,    "0xFF0000", "0x970000")
cap(blue,   "0x0000FF", "0x000097")
cap(yellow, "0xFFFF0F", "0xFFFF0F")
cap(pink,   "0xFF0FFF", "0xFF0FFF")
#undef cap
nessus_translator.P · 2310 B · ext .p · seen 42× in SWH
via fallback
swh:1:cnt:8bd0acb72f6634648a52b82f1a345ca1ed7d9c77;origin=https://github.com/risksense/mulval;anchor=swh:1:rev:369f7484ea5263074f70464a7fada98b6e546df6;path=/src/adapter/nessus_translator.P
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source

:- import member/2 from lists.
hasEffect(privEscalation).

vulExists(Host, CVE, Prog):- 
  vuln_exists(Host, CVE, Prog, _Range, _Losstype, _Severity, _AC ).

vulExists(Host, CVE, Prog):- 
  vuln_exists(Host, CVE, Prog, _Range, _Losstype, _Severity, _AC, Port, Prot ).

vulProperty(CVE, localExploit, Effect):- 
  vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC ),
  member(local,RangeList),
  lossTypetoEffect(Losstype, Effect).

vulProperty(CVE, remoteExploit, Effect, Port, Prot):- 
  vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ),
  member(remoteExploit,RangeList),
  not  member(user_action_req,RangeList),
  lossTypetoEffect(Losstype, Effect).

vulProperty(CVE, remoteExploit, Effect):- 
  vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, _Port, _Prot ),
  member(remoteExploit,RangeList),
  not  member(user_action_req,RangeList),
  lossTypetoEffect(Losstype, Effect).


vulProperty(CVE, remoteClient, Effect):- 
  vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC ),
  member(remoteExploit,RangeList),
  member(user_action_req,RangeList),
  lossTypetoEffect(Losstype, Effect).


lossTypetoEffect(Losstype, Effect):-
            member('data_modification', Losstype),
            hasEffect(Effect).

lossTypetoEffect(Losstype, Effect):-
            member('data_loss', Losstype),
            hasEffect(Effect).

cvss(CVE, AC):-
	vuln_exists(Host, CVE, Prog, _RangeList, _Losstype, _Severity, AC ).

cvss(CVE, AC):-
        vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, AC, Port, Prot ).

networkServiceInfo(Host, Program, Prot, Port, someUser) :-
	vulExists(Host, CVE, Program),
        vulProperty(CVE, remoteExploit, _Effect, Port, Prot).

%hacl(Host, internet, Prot, Port) :-
 %       vuln_exists(Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ).

%hacl(internet, Host, Prot, Port) :-
 %      vuln_exists(Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ).

%this is not corrent, because it binds the CVE Port and Prot together which couldn't be true.
%hacl(Host, Host2, Prot, Port) :-
 %      vuln_exists(Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ),
  %     vuln_exists(Host2, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ).

Contribute — propose a file extension

Tell us where to find evidence about Pawn (mapped to pl/pawn). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Pawn/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Pavia pawn-scripting-language →