SHENZHEN I/O

SHENZHEN I/O

评价数不足
Tesla Challenge 1: Fizzbuzz Test Engine
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
2.219 KB
2017 年 4 月 8 日 上午 11:18
1 项改动说明 ( 查看 )

订阅以下载
Tesla Challenge 1: Fizzbuzz Test Engine

在 89o 的 1 个合集中
SHENZHEN I/O Tesla Challenge Pack
24 件物品
描述
Subject: Preschool toy
From: Wu Lili 吴丽丽 <wulili@longteng-co-ltd.gd.cn>

We've been tasked to create a bunch of 'fizzbuzz test' devices for a Shenzhen preschool. If you don't know, the classic fizzbuzz test is about replacing a number with Fizz if 3 divides it, Buzz if 5 divides it, or Fizzbuzz if both 3 and 5 divide it. Our version will use dials that allow the user to set their own values. This should be an easy task.

---------

Small hint: You need to test for divisibility, which requires the modulo operation. It is easier to do in MCxxxx assembly than division is.

Big hint: To test if b divides a, keep subtracting b from a. If you reach 0, it's divisible; if you reach a negative number before reaching 0, it's not.

Optimization tip: The code to test for divisibility fits into an MC4000X microcontroller.
1 条留言
Verdammte Heinz 2 月 11 日 下午 2:30 
Did it in 8 / 472 / 21