问题标签 [redcode]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
570 浏览

assembly - 帮助理解 RedCode

我正在尝试学习 redcode,因为制作机器人看起来很有趣。

介绍

对于那些不知道什么是 redcode 的人,这里有一个简短的解释。它是一种类似 ASM 的语言,但更加简单和精简。它用于编写需要关闭虚拟内存中其他程序的小程序。(请参阅此处了解更多信息:http: //vyznev.net/corewar/guide.html

这是一段代码:

问题

基本策略是将自身复制到另一个地方,然后分叉该过程。我不明白的是这个规则:

我理解这条线的意思。它说,将目标的 B-Field 移动到顶点 B-Field 所在的线,并减小目标 B-Field 的值。

当第一次执行循环时,第一行将是:

据我所知,带有 Loop 的行的意思是:将指令向前移动 12 行(用 dat #0、#0 填充)到第 833 行。

但是当执行这段代码时,这行代码放在了第 839 行。

有人了解真正发生的事情吗?

0 投票
1 回答
198 浏览

assembly - 核心战争中的小鬼戒指

有人能解释一下核心战争中的小鬼戒指吗?

我认为上面的代码是 '88 标准的,因为它用于end表示程序的开始,并且标签没有冒号。

该程序从启动标签开始。我需要帮助想象这个小鬼环是如何“爬行”在记忆中的。

0 投票
1 回答
93 浏览

assembly - Why isn't this RedCode MOV working?

So, I'm in assembly class, and to keep things interesting, we have tournaments bi-weekly with Core Wars. I'm trying to make a simple application that copies an IMP further down in memory, then jumps back and has two IMPs going at the same time. The idea is once I get this part working to put it into a tight loop and make more than two.

Here's my code:

However, what's happening is the first MOV/SPL doesn't work, and so only the first IMP is running. Where am I going wrong in this logic? It works if I remove ADDR and just use a magic number.

Here's a screen snippet of the memory before it starts running.

Screen Snippet of Memory

Thanks.

0 投票
1 回答
109 浏览

automation - Automating CoreWars

I plan to make an evolutionary program to make redcode warriors for CoreWars. However, I have absolutely no idea how to run the code generated without having to manually open the program and put in the Warriors. Since I hope to have the evolutionary program run through several warriors per minute at least, I'd rather not have to play the role of administrator that much. I'm using the ARES simulator, but as for my research on running warriors through it with a script, I haven't found anything.

I'm really just looking for something like:

SomeSimulator.exe --warrior1 megalordthedestroyer.red --warrior2 tinathebabybunny.red

0 投票
0 回答
49 浏览

assembly - 核心战争,如何复制整个指令

我已经尝试过这些但到目前为止没有运气,接下来是 equak 到 200,move 是 dat 0、200,tot_ins 是 58,

0 投票
0 回答
24 浏览

ffmpeg - 如何使用基于 CLI 的工具(如 ffmpeg)将原始视频格式转换为 mp4/mov?

想要使用命令行工具(如 ffmpeg)将原始视频格式(如 braw、redcode 和 canon 原始格式)转换为 mp4/mov 视频。有用于转换的专用软件,例如用于 braw 格式的 DaVinci Resolve,但我正在寻找可以用作服务的东西并在我的代码中使用它,从而寻找基于 CLI 的解决方案。