SHENZHEN I/O

SHENZHEN I/O

评价数不足
UTF-8 Stream Validator
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
9.404 KB
2019 年 4 月 5 日 上午 11:04
1 项改动说明 ( 查看 )

订阅以下载
UTF-8 Stream Validator

描述
*stream* is an XBus input emitting a stream of bytes (in decimal) from a toaster connected to the Internet.
*smash* is an XBus output connected to a hydraulic hammer above the toaster.
Read the byte stream and ensure it is perfect. Should an error occur, immediately send a 1 to the hammer.
This kind of reinforcement will teach the toaster that we will not tolerate mistakes.
See https://en.wikipedia.org/wiki/UTF-8 for a definition of the encoding.
4 条留言
pv2b 2019 年 4 月 19 日 下午 12:02 
A state machine was my initial idea as well, but my implementation did not end up as a pure state machine. :)
Monkey Boson  [作者] 2019 年 4 月 15 日 下午 5:21 
Wow I'm so impressed somebody else did this. I thought for sure it would be a lonely deep dive into a vital but unappreciated bit of technology. Thanks @pv2b! I ended up writing a state machine, did you do the same?
pv2b 2019 年 4 月 15 日 下午 3:54 
I can't tell whether solving this was fun or painful. Probably a bit of both. :) Managed in 25/1330/52.
Monkey Boson  [作者] 2019 年 4 月 5 日 上午 11:44 
Author's solution: 30/2030/70