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
/* | |
* Performance benchmark (PBM) to compare two implementations (e.g. Daedalus vs. machine code) based on MEM_Benchmark. | |
* Adjust the implementations `pbm_impl_A` and `pbm_impl_B` and compare their performance with `pbm_run()`. | |
*/ | |
const int pbm_loop_num = 10000; | |
func int pbm_impl_A() { | |
// Example: Loop that sums all numbers (Daedalus) | |
var int sum; sum = 0; | |
repeat(i, pbm_loop_num); var int i; |
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
#!/usr/bin/env -S uv run --script | |
# /// script | |
# requires-python = ">=3.13" | |
# dependencies = [ | |
# "cyclopts", | |
# ] | |
# /// | |
import logging | |
import sys |
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
/* | |
* String formatting, given %s (string), %i (integer), and %f (float). The variable number of arguments are expected to | |
* be pushed on the stack. No error handling: If the number or order of arguments does not match, Gothic will crash. | |
* | |
* Example usage: | |
* | |
* MEM_PushStringParam("Mud"); | |
* MEM_PushIntParam(24); | |
* castToIntf(1.2); | |
* out = STR_Format("Hello %s, give me %i ore! That is a %f % percent increase."); |
OlderNewer