我在为 codegolf.se 实现一个笨拙的汇编程序时遇到了麻烦。我设法将一个字符串加载到内存中,找到它的长度,打印字符串 n 次等,但我似乎不能只将非小写数字加载到内存中。因此,让我们采用以下循环来执行一些魔法。(哈希标记是调试标记。)
#,#[>#<[<]<<#+#>>>[>]#,#]<[<]
它从指针 512 开始,并将字符串作为 ascii 值写入 512 之后的点
现在,如果(无论出于何种原因)我希望去掉小写字符,它会在伪 BF 中看起来像这样。
#,#[>#<[<]<<#+#>>>[>]#do{,(takes input and assigns it)}
while(input>=96/*Go arbitrarily to the right for this implementation but
make sure that the first non-lowercase number is stored at the index*/)#
//Also be sure to zero out any temporary cells used
<[<]
现在我的问题是,如何在仅使用 512 右侧的空格作为存储并稍后清除它们的同时实现这样的 while 循环。
对于那些好奇的人,这是我希望在 branfuck 中解决的问题。