feat: add 15 Funge-98 fingerprints and fix test assertion argument order#8
Merged
Merged
Conversation
Copilot
AI
changed the title
[WIP] Implement remaining PyFunge fingerprints
Implement 15 PyFunge fingerprints on feature/fingerprints branch
Jun 11, 2026
…t, FormattedPrintFingerprint, and HighResTimerFingerprintTests
Contributor
|
@copilot dotnet test は実施されましたでしょうか? 現在下記のテストでNGが出ています。
|
Copilot
AI
changed the title
Implement 15 PyFunge fingerprints on feature/fingerprints branch
feat: add 15 new fingerprints (3DSP, CPLI, DIRF, EVAR, FPDP, FPRT, FPSP, HRTI, ICAL, JSTR, ORTH, REFC, SETS, TERM, TOYS)
Jun 12, 2026
Copilot
AI
changed the title
feat: add 15 new fingerprints (3DSP, CPLI, DIRF, EVAR, FPDP, FPRT, FPSP, HRTI, ICAL, JSTR, ORTH, REFC, SETS, TERM, TOYS)
feat: add 15 Funge-98 fingerprints and fix test assertion argument order
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements 15 missing Funge-98 fingerprints and fixes test failures caused by reversed
Assertargument order in EVAR and HRTI test suites.New Fingerprints
3DSP(0x33445350) — 3D space operations: vector math, matrix transforms (A B C D L M N P R S T U V X Y Z)CPLI(0x43504C49) — complex integer arithmetic (A D M O S V)DIRF(0x44495246) — directory operations: make/change/remove (C M R)EVAR(0x45564152) — environment variable get/set/enumerate (G N P V)FPDP(0x46504450) — double-precision float math (A B C D E F G H I K L M N P Q S T V X Y)FPRT(0x46505254) — formatted print for numeric and string types (D F I L S)FPSP(0x46505350) — single-precision float math, same instruction set as FPDPHRTI(0x48525449) — high-resolution timer: mark/measure per IP (E G M S T)ICAL(0x4943414C) — INTERCAL-style bitwise ops and thread control (A F I N O R S X)JSTR(0x4A535452) — jump-relative string get/put (G P)ORTH(0x4F525448) — Orthagonal-mode cell I/O and IP control (A E G O P S V W X Y Z)REFC(0x52454643) — vector reference storage (D R)SETS(0x53455453) — integer set operations (A C D G I M P R S U W X Z)TERM(0x5445524D) — ANSI terminal cursor/screen control (C D G H L S U)TOYS(0x544F5953) — full A–Z toybox: space fill/copy/shift, stack arithmetic, directional helpersAll fingerprints registered in
FingerprintsOptionsandEsolang.Funge.slnx.README.mdfingerprint table andCHANGELOG.mdupdated accordingly.Test Fixes (EVAR & HRTI)
MSTest v3 assertion methods take
(lowerBound, value)/(upperBound, value)— the second argument is the value under test. Several assertions had the arguments reversed, causing spurious failures despite correct implementations:Same inversion corrected for
IsGreaterThanOrEqualTo(HRTI elapsed time, granularity, cloned mark) andIsLessThan(microsecond upper-bound check).Original prompt
Task
Implement the PyFunge fingerprints (https://pythonhosted.org/PyFunge/languages.html#supported-fingerprints) not yet in this repo on top of the
feature/fingerprintsbranch. ReadAGENT.mdand existing fingerprints (e.g.Fingerprints.Roma/,Fingerprints.Strn/,Fingerprints.Time/) before starting.Already implemented (do not re-implement)
NULL, ARRY, BASE, BOOL, DATE, FILE, FIXP, FRTH, IMTH, INDV, LONG, MODU, RAND, ROMA, STCK, STRN, TIME
Fingerprints to implement (15 total)
For each fingerprint, create: library project + source file + README.md, test project + test file, and register in
Interpreter/FingerprintsOptions.cs. Also updateEsolang.Funge.slnx,README.md,CHANGELOG.md.Follow the same project structure as existing fingerprints (see
Fingerprints.Roma/as the simplest template). All projects targetnetstandard2.0;netstandard2.1;net10.0. Test projects targetnet48;net8.0;net9.0;net10.0on Windows,net8.0;net9.0;net10.0on other OSes.New abstraction interface needed
Add
Abstractions/IFungePositionContext.cs(needed by ORTH, TOYS, ICAL):Available optional capability interfaces (check with
ctx is IFoo foo, reflect if missing)IFungeOutputContext: WriteString(string)IFungeInputContext: ReadLine()IFungeVectorContext: PopVector()→(X,Y,Z), PushVector(x,y,z)IFungeSpaceContext: Dimensions, GetCell(x,y,z), SetCell(x,y,z,value)IFungeStorageOffsetContext: StorageOffset→(X,Y,Z)IFungeStackContext: StackDepthIFungeInstructionPointerContext: InstructionPointerIdIFungeInstructionPointerLifecycle: OnInstructionPointerCloned, OnInstructionPointerTerminatedIFungeRandomContext(see Rand fingerprint)IFungePositionContext(new, add to Abstractions)0gnirts helper pattern (copy from STRN)
Pop: read chars until 0. Push: push 0 then chars left-to-right.
FPSP bit encoding
BitConverter.SingleToInt32Bits(float)/Int32BitsToSingle(int)— one cell per float.FPDP bit encoding
Two cells: push lower 32 bits first, upper 32 bits second. Pop upper first, then lower.
Fingerprint Specifications
1. DIRF (0x44495246) — Directory functions
Namespace:
Esolang.Funge.Fingerprints.Dirf, Class:DirectoryFingerprintRef: https://pythonhosted.org/PyFunge/fingerprint/DIRF.html
C: pop path_s → Directory.SetCurrentDirectory; reflect on exceptionM: pop path_s → Directory.CreateDirectory; reflect on exceptionR: pop path_s → Directory.Delete; reflect on exception2. TERM (0x5445524D) — Terminal extension
Namespace:
Esolang.Funge.Fingerprints.Term, Class:TerminalFingerprintRef: https://pythonhosted.org/PyFunge/fingerprint/TERM.html
Uses ANSI escapes via IFungeOutputContext (reflect if unavailable):
C: WriteString("\x1b[2J")H: WriteString("\x1b[H")G: pop c, pop r → WriteString($"\x1b[{r+1};{c+1}H")D: pop n → n>0: "\x1b[{n}B", n<0: "\x1b[{-n}A", n==0: no-opU: pop n → n>0: "\x1b[{n}A", n<0: "\x1b[{-n}B", n==0: no-opL: WriteString("\x1b[K")S: WriteString("\x1b[J")3. REFC (0x52454643) — Referenced Cells Extension
Namespace:
Esolang.Funge.Fingerprints.Refc, Class:ReferencedCellsFingerprintRef: https://pythonhosted.org/PyFunge/fingerprint/REFC.html
Global table (shared across IPs): Dictionary<int,( int X,int Y,int Z)>, auto-increment ref.
R: pop vector_v (PopVector()) → store; push new ref intD: pop ref → PushVector stored vector; reflect if invalidReflect if IFungeVectorContext unavailable.
4. CPLI (0x43504C49) — Complex Integer extension
Namespace:
Esolang.Funge.Fingerprints.Cpli, Class:ComplexIntegerFingerprintRef: https://pythonhosted.org/PyFunge/fingerprint/CPLI.html
Stack layout: real (lower), imag (upper). For binary: pop d(imag2), c(real2), b(imag1), a(real1). Push result real then imag.
A: (a+bi)+(c+di) → push (a+c), (b+d)S: (a+bi)-(c+di) → push (a-c), (b-d)M: (a+bi)*(c+di) → push (ac-bd), (ad+bc)D: (a+bi)/(c+di) truncated; reflect if c==0&&d==0. r=(ac+bd)/(cc+dd), i=(bc-ad)/(cc+dd)O: pop b(imag), pop a(real) → print via IFungeOutputContext; reflect if unavailableV: pop b, pop a → push (int)Math.Sqrt(aa+bb)5. EVAR (0x45564152) — Environment variables extension
Namespace:
Esolang.Funge.Fingerprints.Evar, Class:EnvironmentVariablesFingerprintRef: https://pythonhosted.org/PyFunge/fingerprint/EVAR.html
G: pop name_s → push value_s (empty string if not found)N: push Environment.GetEnvironmentVariables().CountP: pop namevalue_s (format "name=value") → setenv; reflect if no '='V: pop i → push i-th env var sorted by key as "name=value" 0gnirts; reflect if out of range6. HRTI (0x48525449) — High-Resolution Timer Interface
Namespace:
Esolang.Funge.Fingerprints.Hrti, Class: `HighResTim...