SkillAgentSearch skills...

Hmars

A fast and feature-rich Memory Array Redcode Simulator for playing Corewar.

Install / Use

/learn @aerkiaga/Hmars
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Stuff

<!--- [//]: # (![Stuff](https://img.shields.io/static/v1.svg?label=test&message=failed&color=critical)) [//]: # (![Stuff](https://img.shields.io/static/v1.svg?label=test&message=untested&color=important)) --->

hmars

A fast and feature-rich Memory Array Redcode Simulator for Corewar.

WARNING: This is a work-in-progress; the current version should not be considered stable, and still contains much unfinished code.

Installation (Linux-only)

First, install the required dependencies. The latest GNU LibJIT is required at the moment, and it must be built from source. GNU Autotools are required; on an Ubuntu-based distro they can be obtained with:

sudo apt-get install automake autotools-dev libtool

Then, build and install LibJIT:

git clone https://git.savannah.gnu.org/git/libjit.git
cd libjit
./bootstrap
./configure --prefix=/usr/local
make
sudo make install

If the optional SDL debugger is desired, then install SDL 2 too:

sudo apt-get install libsdl2-dev

Take a look at src/config.h, this contains several useful configuration options. Also inspect the Makefile, for changing the default compiler and flags.

Build one of the following:

  • Type make hmars to build the command-line version.
  • Type make hmars-gui to build the SDL interactive debugger.
  • Type make or make all to build both of them.

Optionally, run ./hmars --test to check that everything is right. This depends on the warriors found in ./test to work. If a pMARS executable is present in the current directory as ./pmars, hMARS will check itself against it.

Usage

Command line

hmars [options] file1 [-l loadfile] file2 ...
hmars --test
hmars-gui [options] file1 [-l loadfile] file2 ...

Option | Description | Default ------ | ------------|--------- -r <rounds> | Set number of rounds to fight. | 1 -s <size> | Size of core in instructions. | 8000 -c <cycles> | Maximum number of cycles per round. | 80000 -p <procs> | Maximum number of processes per warrior. | 8000 -l <length> | Maximum warrior length. | 100 -d <dist> | Minimum distance between warriors. | 100 -F <position> | Fixed position of second warrior (needs exactly 2 warriors). | None -S <size> | Size of P-space in cells. | CORESIZE/16 -L <loadfile> | Must come after warrior file, specifies optional load file to output. | None -V | Increase verbosity by one level, up to 2 levels. | - --test | Ignores remaining options and performs self-test. | -

Debugger

The debugger is not currently finished. For now, it only displays the ongoing round in a rectangular area, which can be resized.

Symbols | Meaning ------ | ------- ⠀⠀   ⠀⠀       | None ⠐⠀   ⠁⠀       | Read from ⠕⠅   ⠑⠀       | Written to ⠺⠂   ⠃⠀       | Incremented ⠒⠂   ⠉⠀       | Decremented ⠿⠇   ⠛⠀       | Executed ⣿⣿   ⠿⠇       | In execution

Color | Instruction | Color | Instruction ----- | ----------- | ----- | ----------- Stuff | DAT | Stuff | MOV Stuff | ADD | Stuff | SUB Stuff | MUL | Stuff | DIV Stuff | MOD | Stuff | JMP Stuff | JMZ | Stuff | JMN Stuff | DJZ** | Stuff | DJN Stuff | SEQ/CMP | Stuff | SNE Stuff | SLT | Stuff | SPL Stuff | NOP | Stuff | LDP Stuff | STP | Stuff | XCH* Stuff | PCT* | Stuff | STS*

* non-standard extensions
** non-standard extension, part of pre-ICWS ('84)

View on GitHub
GitHub Stars10
CategoryDevelopment
Updated2y ago
Forks0

Languages

C

Security Score

75/100

Audited on Jun 1, 2023

No findings