Programming

That reminds me - while I hope to never have to deal with even a microscopic fraction of the shit this site has dealt with, I should probably at some point learn what is behind kiwiflare and the rest of the things Null/the admins have built to stay online. It deserves Matrix memes. Truly impressive.
It's similar in principle to Hashcash, which was designed to restrict email spam.
 
It's 6502-based. You get two registers lol
.org $8000 ; Program origin

start:
QINIT ; Initialize quantum registers
QH q0 ; Apply Hadamard gate to q0
QH q1 ; Apply Hadamard gate to q1
QH q2 ; Apply Hadamard gate to q2
QH q3 ; Apply Hadamard gate to q3
QH q4 ; Apply Hadamard gate to q4
QH q5 ; Apply Hadamard gate to q5
QH q6 ; Apply Hadamard gate to q6
QH q7 ; Apply Hadamard gate to q7
QRAND a ; Measure q0-q7 into A (random 0-255)

; Convert to 1-10
and #$0F ; Mask to 0-15 (lower 4 bits)
cmp #10 ; Compare with 10
bcc adjust ; If < 10, skip subtraction
sbc #10 ; Subtract 10 if >= 10
adjust:
clc ; Clear carry
adc #1 ; Add 1 (range 1-10)
sta count ; Store repetition count

ldy #0 ; Y counts repetitions

outer_loop:
cpy count ; Compare Y with count
beq done ; If equal, exit
ldx #0 ; X indexes message characters

inner_loop:
cpx #35 ; Compare X with message length
beq next ; If 35, finish this message
lda msg, x ; Load character
jsr $FFD2 ; Print character
inx ; Next character
jmp inner_loop ; Repeat

next:
iny ; Increment repetition counter
jmp outer_loop ; Print message again

done:
jmp done ; Infinite loop to end

.org $8100 ; Data section
msg:
.byte 'T', 'h', 'a', 't', ' ', 's', 'h', 'i', 't', ' ', 'i', 's', ' ', 'g', 'o', 'i', 'n', 'g', ' ', 't', 'o', ' ', 's', 'u', 'c', 'k', ',', ' ', 'K', 'a', 't', 's', 'u', '!', 0x0a
count:
.byte 0 ; Storage for repetition count
 
  • Autistic
Reactions: Shlomo XL
Back