A few TIS-100 specifications. Difficulty varies according to how comfortable the player is with binary...
To use, copy the source to one of the specifications from here, go to the Specification Editor ingame, and click on "Import Specification From Clipboard"
function get_name() return "SERIAL TO PARALLEL" end
function get_description() return {"INPUT IS 8-BIT SERIAL STREAM WITH NO STOP BITS OR PARITY", "INPUT IS LITTLE ENDIAN", "OUTPUT IS DECODED BYTES"} end
function get_streams()
local input,output = {},{}
for i = 1,4 do
local result = 0
for n=1,8 do
if math.random(0,1) == 1 then
input[#input+1] = 1
result = result * 2 + 1
else
input[#input+1] = 0
result = result * 2
end
end
output[#output+1] = result
end
return {{STREAM_INPUT,"IN",1,input},{STREAM_OUTPUT,"OUT",1,output}}
end
function get_layout() return {TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE} end
function get_name() return "SERIAL TO PARALLEL, BE" end
function get_description() return {"INPUT IS 8-BIT SERIAL STREAM WITH NO STOP BITS OR PARITY", "INPUT IS BIG ENDIAN", "OUTPUT IS DECODED BYTES"} end
function get_streams()
local input,output = {},{}
for i = 1,4 do
local result = 0
local add = 1
for n=1,8 do
if math.random(0,1) == 1 then
input[#input+1] = 1
result = result + add
else
input[#input+1] = 0
end
add = add * 2
end
output[#output+1] = result
end
return {{STREAM_INPUT,"IN",1,input},{STREAM_OUTPUT,"OUT",1,output}}
end
function get_layout() return {TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE} end
function get_name() return "PARALLEL TO SERIAL" end
function get_description() return {"OUTPUT IS 8-BIT SERIAL STREAM WITH NO STOP BITS OR PARITY", "OUTPUT IS LITTLE ENDIAN"} end
function get_streams()
local input,output = {},{}
for i = 1,4 do
local result = 0
for n=1,8 do
if math.random(0,1) == 1 then
output[#output+1] = 1
result = result * 2 + 1
else
output[#output+1] = 0
result = result * 2
end
end
input[#input+1] = result
end
return {{STREAM_INPUT,"IN",1,input},{STREAM_OUTPUT,"OUT",1,output}}
end
function get_layout() return {TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE,TILE_COMPUTE} end