Skip to content

0xd34df00d/fizzbuzz-i

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 

Repository files navigation

fizzbuzz

If OOP folks have their FizzBuzz, why can't we have our own?

This is an implementation of the FizzBuzz game, formally verified, provably correct, Idris version. It is built almost entirely from scratch, including our very own natural numbers with our own (formally verified, provably correct) division procedure.

The rules of FizzBuzz are as follows. For numbers 1 through 100:

  • if the number is divisible by 3 print Fizz;
  • if the number is divisible by 5 print Buzz;
  • if the number is divisible by 3 and 5 (15) print FizzBuzz;
  • else, print the number.

Dependent types allow ensuring that Fizz is printed iff the number is divisible by 3, and Buzz is printed iff the number is divisible by 5. There is no actual printing procedure because, as usual, the code is not intended to be run, but just type-checked.

Generalizing fizzbuzz to arbitrary algebraic structures (instead of just natural numbers) is planned for version 2.

About

FizzBuzz, formally verified, provably correct

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages