SHENZHEN I/O - Diagnostic Pulse Generator - Solution

preview_player
Показать описание
Final solution is at 0:24.
Also known as PULSE GENERATOR.

Рекомендации по теме
Комментарии
Автор

I thought I was a good programmer, till I saw how simple you guys codes are.
loop:
teq p0 100
+ jmp pulse
slp 1
jmp loop
pulse:
mov 100 p1
slp 1
teq p0 100
mov 0 p1
slp 1
teq p0 100
- jmp loop
+ jmp pulse

FPO
Автор

Tried for a secondary solution:
mul p0
mul -1
add p0
mov acc p1
slp 1

Terrible power usage, but the fact that it doesn't use conditionals seems really cool to me

DanielWillen
Автор

The code is elegant but there is too many steps in the sleep cycle so it becomes heavy on the power usage.

NoNsEnSe
Автор

teq 100 p0
+ gen p1 1 1
- slp 1

the "gen" command does 4 lines of code at once but is absent from the english manual because of course

KolpoPirate
Автор

a:
teq p0 100
+ jmp b
- mov 0 p1
- mov 0 acc
slp 1
jmp a
b:
teq acc 0
+ mov 100 acc
- mov 0 acc
mov acc p1
slp 1
jmp a

gef

zayleex
welcome to shbcf.ru