├── Makefile ├── fizzbuzz.fizzbuzz ├── fizzbuzz.raku ├── fizzbuzz.hs ├── fizzbuzz.gp ├── fizzbuzz.pl ├── fizzbuzz.ts ├── fizzbuzz.js ├── fizzbuzz.py3 ├── fizzbuzz.zsh ├── fizzbuzz.d ├── fizzbuzz.elvish ├── fizzbuzz.rexx ├── fizzbuzz.sl ├── fizzbuzz.kt ├── fizzbuzz.tcl ├── fizzbuzz.fish ├── fizzbuzz.bash ├── fizzbuzz.groovy ├── fizzbuzz.nim ├── fizzbuzz.rb ├── fizzbuzz.octave ├── fizzbuzz.clojure ├── fizzbuzz.swift ├── fizzbuzz.cat ├── fizzbuzz.r ├── fizzbuzz.calc ├── fizzbuzz.m4 ├── fizzbuzz.fal ├── fizzbuzz.xpl ├── fizzbuzz.squirrel ├── fizzbuzz.nickle ├── fizzbuzz.sh ├── fizzbuzz.tab ├── fizzbuzz.bc ├── fizzbuzz.by ├── fizzbuzz.ps1 ├── fizzbuzz.io ├── fizzbuzz.jl ├── fizzbuzz.icn ├── fizzbuzz.cr ├── fizzbuzz.pas ├── fizzbuzz.rs ├── fizzbuzz.gdb ├── fizzbuzz.php ├── fizzbuzz.csh ├── fizzbuzz.curl ├── fizzbuzz.rc ├── fizzbuzz.myr ├── fizzbuzz.vala ├── fizzbuzz.gravity ├── fizzbuzz.py2 ├── fizzbuzz.hodor ├── fizzbuzz.nqp ├── fizzbuzz.v ├── fizzbuzz.clisp ├── fizzbuzz.aribas ├── fizzbuzz.cpp ├── fizzbuzz.picolisp ├── fizzbuzz.erl ├── fizzbuzz.lua ├── fizzbuzz.pike ├── fizzbuzz.st ├── fizzbuzz.a68 ├── fizzbuzz.awk ├── fizzbuzz.adb ├── fizzbuzz.wren ├── fizzbuzz.c ├── fizzbuzz.pure ├── fizzbuzz.lily ├── fizzbuzz.vb ├── fizzbuzz.elisp ├── fizzbuzz.fs ├── fizzbuzz.java ├── fizzbuzz.dart ├── fizzbuzz.gpt ├── fizzbuzz.sd7 ├── fizzbuzz.guile ├── fizzbuzz.l ├── fizzbuzz.go ├── fizzbuzz.vg ├── fizzbuzz.f90 ├── fizzbuzz.zig ├── fizzbuzz.nodejs ├── fizzbuzz.ps ├── fizzbuzz.pli ├── fizzbuzz.setl ├── fizzbuzz.cs ├── fizzbuzz.ratfor ├── fizzbuzz.vim ├── fizzbuzz.f ├── fizzbuzz.scala ├── fizzbuzz.c3 ├── fizzbuzz.hx ├── fizzbuzz.lol ├── fizzbuzz.sqlite3 ├── fizzbuzz.f66 ├── expected-output.txt ├── sh6-bug ├── config.h ├── sh6-bug.bash ├── README.md ├── make-check.out ├── sh6-bug.bash.out └── sh6-bug.bash-strace.out ├── fizzbuzz.b ├── fizzbuzz.logo ├── fizzbuzz.sim ├── fizzbuzz.m ├── install-prereqs ├── fizzbuzz.bas ├── fizzbuzz.sed ├── fizzbuzz.ed ├── fizzbuzz.tail ├── fizzbuzz.ws ├── fizzbuzz.sh6 ├── fizzbuzz.mod ├── fizzbuzz.a60 ├── fizzbuzz.cob ├── list.txt ├── fizzbuzz.gcc ├── TODO.md ├── fizzbuzz.mk ├── verify ├── fizzbuzz.sx └── README.md /Makefile: -------------------------------------------------------------------------------- 1 | list.txt: 2 | git ls-files 'fizzbuzz.*' > $@ 3 | -------------------------------------------------------------------------------- /fizzbuzz.fizzbuzz: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env fizzbuzz 2 | 3 | # Language: FizzBuzz 4 | # Web site: https://github.com/Keith-S-Thompson/fizzbuzz 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: Not available as an Linux Mint package; install the 7 | # "fizzbuzz" command from the GitHub project 8 | -------------------------------------------------------------------------------- /fizzbuzz.raku: -------------------------------------------------------------------------------- 1 | #!/usr/bin/rakudo 2 | 3 | # Language: Raku (formerly Perl6) 4 | # Web site: https://raku.org/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: apt-get install rakudo 7 | 8 | $_.say for [(0..∞).map:{ 9 | $_ % 15 == 0 ?? "FizzBuzz" !! 10 | $_ % 3 == 0 ?? "Fizz" !! 11 | $_ % 5 == 0 ?? "Buzz" !! 12 | $_ 13 | }][1..100]; 14 | -------------------------------------------------------------------------------- /fizzbuzz.hs: -------------------------------------------------------------------------------- 1 | -- Language: Haskell 2 | -- Web site: https://www.haskell.org/ 3 | -- Last tested on: Ubuntu 24.04.2 LTS 4 | -- Requires: apt-get install ghc 5 | 6 | line n 7 | | n `mod` 15 == 0 = "FizzBuzz" 8 | | n `mod` 3 == 0 = "Fizz" 9 | | n `mod` 5 == 0 = "Buzz" 10 | | otherwise = show n 11 | 12 | main = mapM (putStrLn . line)[1..100] 13 | -------------------------------------------------------------------------------- /fizzbuzz.gp: -------------------------------------------------------------------------------- 1 | \\ Language: PARI/GP 2 | \\ Web site: https://pari.math.u-bordeaux.fr/ 3 | \\ Last tested on: Ubuntu 24.04.2 LTS 4 | \\ Requires: apt-get install pari-gp 5 | 6 | for (i = 1, 100, \ 7 | if (i % 15 == 0, print("FizzBuzz"), \ 8 | i % 3 == 0, print("Fizz"), \ 9 | i % 5 == 0, print("Buzz"), \ 10 | print(i)) \ 11 | ) 12 | quit(0) 13 | -------------------------------------------------------------------------------- /fizzbuzz.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Language: Perl 4 | # Web site: https://www.perl.org/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: The "perl" package is pre-installed 7 | 8 | use strict; 9 | use warnings; 10 | 11 | for (1..100) { 12 | my $s = ''; 13 | $_%3 or $s.='Fizz'; 14 | $_%5 or $s.='Buzz'; 15 | $s or $s.=$_; 16 | print "$s\n"; 17 | } 18 | -------------------------------------------------------------------------------- /fizzbuzz.ts: -------------------------------------------------------------------------------- 1 | // Language: TypeScript 2 | // Web site: https://www.typescriptlang.org/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: apt-get install node-typescript 5 | 6 | var i:number 7 | for (i = 1; i <= 100; i ++) { 8 | console.log(i % 15 == 0 ? "FizzBuzz" : 9 | i % 3 == 0 ? "Fizz" : 10 | i % 5 == 0 ? "Buzz" : 11 | i) 12 | } 13 | -------------------------------------------------------------------------------- /fizzbuzz.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/node 2 | 3 | // Language: JavaScript 4 | // Web site: https://developer.mozilla.org/en-US/docs/JavaScript 5 | // Last tested on: Ubuntu 24.04.2 LTS 6 | // Requires: apt-get install nodejs 7 | 8 | for (i = 1; i <= 100; i ++) { 9 | console.log(i % 15 == 0 ? "FizzBuzz" : 10 | i % 3 == 0 ? "Fizz" : 11 | i % 5 == 0 ? "Buzz" : 12 | i) 13 | } 14 | -------------------------------------------------------------------------------- /fizzbuzz.py3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # Language: Python 3 4 | # Web site: https://www.python.org/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: The "python3" package is pre-installed 7 | 8 | for i in range(1, 101): 9 | if i % 15 == 0: 10 | print("FizzBuzz") 11 | elif i % 3 == 0: 12 | print("Fizz") 13 | elif i % 5 == 0: 14 | print("Buzz") 15 | else: 16 | print(i) 17 | -------------------------------------------------------------------------------- /fizzbuzz.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | # Language: zsh 4 | # Web site: https://www.zsh.org/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: apt-get install zsh 7 | 8 | for (( i = 1; i <= 100; i ++ )) { 9 | if (( i % 15 == 0 )) { 10 | echo FizzBuzz 11 | } elif (( i % 3 == 0 )) { 12 | echo Fizz 13 | } elif (( i % 5 == 0 )) { 14 | echo Buzz 15 | } else { 16 | echo $i 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fizzbuzz.d: -------------------------------------------------------------------------------- 1 | // Language: D 2 | // Web site: https://dlang.org/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: apt-get install gdc 5 | 6 | import std.stdio; 7 | import std.string; 8 | void main() { 9 | foreach (i; 1..101) { 10 | ( i % 15 == 0 ? "FizzBuzz" : 11 | i % 3 == 0 ? "Fizz" : 12 | i % 5 == 0 ? "Buzz" : 13 | format("%d", i) 14 | ).writeln(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /fizzbuzz.elvish: -------------------------------------------------------------------------------- 1 | #!/usr/bin/elvish 2 | 3 | # Language: Elvish 4 | # Web site: https://elvish.io/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: apt-get install elvish 7 | 8 | for i [ ( seq 1 100 ) ] { 9 | if (== (% $i 15) 0) { 10 | echo FizzBuzz 11 | } elif (== (% $i 3) 0) { 12 | echo Fizz 13 | } elif (== (% $i 5) 0) { 14 | echo Buzz 15 | } else { 16 | echo $i 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fizzbuzz.rexx: -------------------------------------------------------------------------------- 1 | #!/usr/bin/rexx 2 | 3 | /* 4 | * Language: REXX 5 | * Web site: https://regina-rexx.sourceforge.io/ 6 | * Last tested on: Ubuntu 24.04.2 LTS 7 | * Requires: apt-get install regina-rexx 8 | */ 9 | 10 | DO I = 1 TO 100 11 | IF I // 15 = 0 THEN 12 | SAY "FizzBuzz" 13 | ELSE IF I // 3 = 0 THEN 14 | SAY "Fizz" 15 | ELSE IF I // 5 = 0 THEN 16 | SAY "Buzz" 17 | ELSE 18 | SAY I 19 | END 20 | -------------------------------------------------------------------------------- /fizzbuzz.sl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/slsh 2 | 3 | % Language: S-Lang 4 | % Web site: https://www.jedsoft.org/slang/ 5 | % Last tested on: Ubuntu 24.04.2 LTS 6 | % Requires: apt-get install slsh 7 | 8 | variable i; 9 | for (i = 1; i <= 100; ++i) { 10 | if (i mod 15 == 0) printf("FizzBuzz\n"); 11 | else if (i mod 3 == 0) printf("Fizz\n"); 12 | else if (i mod 5 == 0) printf("Buzz\n"); 13 | else printf("%d\n", i); 14 | } 15 | -------------------------------------------------------------------------------- /fizzbuzz.kt: -------------------------------------------------------------------------------- 1 | // Language: Kotlin 2 | // Web site: https://kotlinlang.org/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: snap install kotlin 5 | 6 | fun main() { 7 | for (i in 1..100) { 8 | when (i % 15) { 9 | 0 -> println("FizzBuzz") 10 | 3, 6, 9, 12 -> println("Fizz") 11 | 5, 10 -> println("Buzz") 12 | else -> println(i) 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /fizzbuzz.tcl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/tclsh 2 | 3 | # Language: Tcl 4 | # Web site: https://www.tcl.tk/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: The "tcl" package is pre-installed 7 | 8 | for {set i 1} {$i<= 100} {incr i} { 9 | if {$i % 15 == 0} { 10 | puts "FizzBuzz" 11 | } elseif {$i % 3 == 0} { 12 | puts "Fizz" 13 | } elseif {$i % 5 == 0} { 14 | puts "Buzz" 15 | } else { 16 | puts $i 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fizzbuzz.fish: -------------------------------------------------------------------------------- 1 | #!/usr/bin/fish 2 | 3 | # Language: fish shell 4 | # Web site: https://fishshell.com/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: apt-get install fish 7 | 8 | for i in (seq 1 100) 9 | if test (math $i \% 15) -eq 0 10 | echo FizzBuzz 11 | else if test (math $i \% 3) -eq 0 12 | echo Fizz 13 | else if test (math $i \% 5) -eq 0 14 | echo Buzz 15 | else 16 | echo $i 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /fizzbuzz.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Language: bash 4 | # Web site: https://www.gnu.org/software/bash/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: The "bash" package is pre-installed 7 | 8 | for i in {1..100} ; do 9 | if (( i % 15 == 0 )) ; then 10 | echo FizzBuzz 11 | elif (( i % 3 == 0 )) ; then 12 | echo Fizz 13 | elif (( i % 5 == 0 )) ; then 14 | echo Buzz 15 | else 16 | echo $i 17 | fi 18 | done 19 | -------------------------------------------------------------------------------- /fizzbuzz.groovy: -------------------------------------------------------------------------------- 1 | // Language: Groovy 2 | // Web site: https://groovy-lang.org/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: apt-get install groovy openjdk-7-jdk 5 | 6 | 1.upto(100) { 7 | if (it % 15 == 0) { 8 | println "FizzBuzz" 9 | } 10 | else if (it % 3 == 0) { 11 | println "Fizz" 12 | } 13 | else if (it % 5 == 0) { 14 | println "Buzz" 15 | } 16 | else { 17 | println it 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fizzbuzz.nim: -------------------------------------------------------------------------------- 1 | # Language: Nim 2 | # Web site: http://nim-lang.org/ 3 | # Last tested on: Ubuntu 24.04.2 LTS 4 | # Requires: apt-get install nim 5 | 6 | template foreach(i, lo, hi, actions) = 7 | for i in lo..hi: 8 | actions 9 | 10 | proc line(i: int): string = 11 | result = "" 12 | if i mod 3 == 0: result &= "Fizz" 13 | if i mod 5 == 0: result &= "Buzz" 14 | if result == "": result = $i 15 | 16 | foreach(i, 1, 100): 17 | i.line.echo 18 | -------------------------------------------------------------------------------- /fizzbuzz.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ruby 2 | 3 | # Language: Ruby 4 | # Web site: https://www.ruby-lang.org/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: apt-get install ruby 7 | 8 | (1..100).each do |i| 9 | puts "#{if i % 15 == 0 10 | "FizzBuzz" 11 | elsif i % 3 == 0 12 | "Fizz" 13 | elsif i % 5 == 0 14 | "Buzz" 15 | else 16 | i 17 | end}" 18 | end 19 | -------------------------------------------------------------------------------- /fizzbuzz.octave: -------------------------------------------------------------------------------- 1 | #!/usr/bin/octave -q 2 | 3 | % Language: Octave (should be compatible with Matlab) 4 | % Web site: https://octave.org/ 5 | % Last tested on: Ubuntu 24.04.2 LTS 6 | % Requires: apt-get install octave 7 | 8 | for i=1:100 9 | if (mod(i, 15) == 0) 10 | disp('FizzBuzz') 11 | elseif (mod(i, 3) == 0) 12 | disp('Fizz') 13 | elseif (mod(i, 5) == 0) 14 | disp('Buzz') 15 | else 16 | disp(int2str(i)) 17 | endif 18 | end 19 | -------------------------------------------------------------------------------- /fizzbuzz.clojure: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clojure 2 | 3 | ; Language: Clojure 4 | ; Web site: https://clojure.org/ 5 | ; Last tested on: Ubuntu 24.04.2 LTS 6 | ; Requires: apt-get install clojure 7 | 8 | (defn line [n] 9 | (cond 10 | (= 0 (mod n 15)) "FizzBuzz" 11 | (= 0 (mod n 3)) "Fizz" 12 | (= 0 (mod n 5)) "Buzz" 13 | :else (format "%d" n) 14 | ) 15 | ) 16 | 17 | (defn print-line [n] (println (line n))) 18 | 19 | (dorun (map print-line (range 1 101))) 20 | -------------------------------------------------------------------------------- /fizzbuzz.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env swift 2 | 3 | // Language: Swift 4 | // Web site: https://swift.org/ 5 | // Last tested on: Ubuntu 24.04.2 LTS 6 | // Requires: Install swift-5.8-RELEASE-ubuntu22.04.tar.gz 7 | 8 | for i in 1...100 { 9 | if i % 15 == 0 { 10 | print("FizzBuzz") 11 | } 12 | else if (i % 3 == 0) { 13 | print("Fizz") 14 | } 15 | else if (i % 5 == 0) { 16 | print("Buzz") 17 | } 18 | else { 19 | print(i) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fizzbuzz.cat: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Language: cat 4 | # Web site: https://www.gnu.org/software/coreutils/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: The "coreutils" package is pre-installed 7 | 8 | # NOTE: This is cheating; "cat" is not really a scripting language, 9 | # This depends on the existence of the expected-output.txt file 10 | # (provided with this project) in the parent directory (the test 11 | # is run in a temporary subdirectory) 12 | 13 | cat ../expected-output.txt 14 | -------------------------------------------------------------------------------- /fizzbuzz.r: -------------------------------------------------------------------------------- 1 | #!/usr/bin/R --slave -f 2 | 3 | # Language: R 4 | # Web site: https://www.r-project.org/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: apt-get install r-base-core 7 | 8 | 9 | for (i in 1:100) { 10 | if (i %% 15 == 0) { 11 | cat("FizzBuzz\n") 12 | } 13 | else if (i %% 3 == 0) { 14 | cat("Fizz\n") 15 | } 16 | else if (i %% 5 == 0) { 17 | cat("Buzz\n") 18 | } 19 | else { 20 | cat(i, "\n", sep="") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fizzbuzz.calc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/calc -f 2 | 3 | ## Language: Calc 4 | ## Web site: https://www.isthe.com/chongo/tech/comp/calc/ 5 | ## Last tested on: Ubuntu 24.04.2 LTS 6 | ## Requires: apt-get install calc 7 | 8 | for (i = 1; i <= 100; i ++) { 9 | if (i % 15 == 0) { 10 | print "FizzBuzz"; 11 | } 12 | else if (i % 3 == 0) { 13 | print "Fizz"; 14 | } 15 | else if (i % 5 == 0) { 16 | print "Buzz"; 17 | } 18 | else { 19 | print i 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fizzbuzz.m4: -------------------------------------------------------------------------------- 1 | dnl Language: m4 2 | dnl Web site: http://www.gnu.org/software/m4/ 3 | dnl Last tested on: Ubuntu 24.04.2 LTS 4 | dnl Requires: The "m4" package is pre-installed 5 | define(`line', `ifelse(eval($1 % 15), `0', `FizzBuzz 6 | ', 7 | eval($1 % 3), `0', `Fizz 8 | ', 9 | eval($1 % 5), `0', `Buzz 10 | ', 11 | `$1 12 | ')')define(`lines', `ifelse(eval($1 <= $2), `1', `line($1)'`lines(eval($1 + 1), $2)', `')')lines(1, 100)dnl 13 | -------------------------------------------------------------------------------- /fizzbuzz.fal: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env falcon 2 | 3 | // Language: Falcon 4 | // Web site: http://falconpl.org 5 | // Last tested on: Ubuntu 24.04.2 LTS 6 | // Requires: Build from source, Falcon-0.9.6.8.tgz 7 | // (There doesn't seem to be be a falconpl package for Ubuntu 17.10) 8 | 9 | for i in [1:101] 10 | if i % 15 == 0 11 | > "FizzBuzz" 12 | elif i % 3 == 0 13 | > "Fizz" 14 | elif i % 5 == 0 15 | > "Buzz" 16 | else 17 | > i 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /fizzbuzz.xpl: -------------------------------------------------------------------------------- 1 | /* 2 | * Language: XPL 3 | * Web site: https://sourceforge.net/projects/xpl-compiler/ 4 | * Last tested on: Ubuntu 24.04.2 LTS 5 | * Requires: Download xpl0006.zip, unpack, build and install from source 6 | */ 7 | 8 | declare i fixed; 9 | do i = 1 to 100; 10 | if i mod 15 = 0 then 11 | output = 'FizzBuzz'; 12 | else if i mod 3 = 0 then 13 | output = 'Fizz'; 14 | else if i mod 5 = 0 then 15 | output = 'Buzz'; 16 | else 17 | output = i; 18 | end; 19 | -------------------------------------------------------------------------------- /fizzbuzz.squirrel: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sq 2 | 3 | // Language: Squirrel 4 | // Web site: http://squirrel-lang.org/ 5 | // Last tested on: Ubuntu 24.04.2 LTS 6 | // Requires: Build from source (v3.2) 7 | 8 | for (local i = 1; i <= 100; i += 1) { 9 | if (i % 15 == 0) { 10 | print("FizzBuzz\n"); 11 | } 12 | else if (i % 3 == 0) { 13 | print("Fizz\n"); 14 | } 15 | else if (i % 5 == 0) { 16 | print("Buzz\n"); 17 | } 18 | else { 19 | print(i + "\n"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fizzbuzz.nickle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/nickle 2 | 3 | # Language: Nickle 4 | # Web site: https://nickle.org/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: apt-get install nickle 7 | 8 | for (i = 1; i <= 100; i ++) { 9 | if (i % 15 == 0) { 10 | printf("%s\n", "FizzBuzz"); 11 | } 12 | else if (i % 3 == 0) { 13 | printf("%s\n", "Fizz"); 14 | } 15 | else if (i % 5 == 0) { 16 | printf("%s\n", "Buzz"); 17 | } 18 | else { 19 | printf("%d\n", i); 20 | } 21 | } 22 | exit(0); 23 | -------------------------------------------------------------------------------- /fizzbuzz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Language: Bourne shell 4 | # Web site: (Defined by POSIX; see opengroup.org) 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: The "dash" package is pre-installed 7 | 8 | i=1 9 | while [ $i -le 100 ] ; do 10 | if [ `expr $i % 15` -eq 0 ] ; then 11 | echo FizzBuzz 12 | elif [ `expr $i % 3` -eq 0 ] ; then 13 | echo Fizz 14 | elif [ `expr $i % 5` -eq 0 ] ; then 15 | echo Buzz 16 | else 17 | echo $i 18 | fi 19 | i=`expr $i + 1` 20 | done 21 | -------------------------------------------------------------------------------- /fizzbuzz.tab: -------------------------------------------------------------------------------- 1 | # Language: Tab 2 | # Web site: https://bitbucket.org/tkatchev/tab/src/master/ 3 | # Last tested on: Ubuntu 24.04.2 LTS 4 | # Requires: Clone the git repo at http://bitbucket.org/tkatchev/tab 5 | # `make` 6 | # Install `tab` in $PATH as `tab` 7 | 8 | # Tab does not appear to have any comment syntax. 9 | # The `verify` script removes these lines before invoking `tab`. 10 | 11 | [ if (@ % 15 == 0, "FizzBuzz", if (@ % 3 == 0, "Fizz", if (@ % 5 == 0, "Buzz", string(@)))) : count(100) ] 12 | -------------------------------------------------------------------------------- /fizzbuzz.bc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bc -q 2 | 3 | /* 4 | * Language: bc 5 | * Web page: https://www.gnu.org/software/bc/ 6 | * Last tested on: Ubuntu 24.04.2 LTS 7 | * Requires: The "bc" package is pre-installed 8 | */ 9 | 10 | for (i=1; i<=100; i++) { 11 | printed=0 12 | if (i % 3 == 0) { 13 | print "Fizz" 14 | printed=1 15 | } 16 | if (i % 5 == 0) { 17 | print "Buzz" 18 | printed=1 19 | } 20 | if (!printed) { 21 | print i 22 | } 23 | print "\n" 24 | } 25 | 26 | halt 27 | -------------------------------------------------------------------------------- /fizzbuzz.by: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bython 2 | 3 | # Language: Bython 4 | # Web site: https://github.com/mathialo/bython 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: pip3 install bython 7 | # With recent Ubuntu and Python, requires a venv 8 | 9 | for i in range(1, 101) { 10 | if i % 15 == 0 { 11 | print("FizzBuzz") 12 | } 13 | elif i % 3 == 0 { 14 | print("Fizz") 15 | } 16 | elif i % 5 == 0 { 17 | print("Buzz") 18 | } 19 | else { 20 | print(i) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fizzbuzz.ps1: -------------------------------------------------------------------------------- 1 | #!/snap/bin/pwsh 2 | 3 | # Language: PowerShell 4 | # Web site: https://github.com/PowerShell/PowerShell 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: snap install powershell 7 | 8 | For ( $i = 1 9 | $i -le 100 10 | $i ++ ) 11 | { 12 | If ($i % 15 -eq 0) { 13 | Write-Host FizzBuzz 14 | } 15 | ElseIf ($i % 3 -eq 0) { 16 | Write-Host Fizz 17 | } 18 | ElseIf ($i % 5 -eq 0) { 19 | Write-Host Buzz 20 | } 21 | Else { 22 | Write-Host $i 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fizzbuzz.io: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/io 2 | 3 | // Language: Io 4 | // Web site: http://iolanguage.org/ 5 | // Last tested on: Ubuntu 24.04.2 LTS1 6 | // Requires: apt-get install iolanguage 7 | // (installs under /usr/local for some reason) 8 | 9 | for (i, 1, 100, 10 | if (i % 15 == 0, 11 | writeln("FizzBuzz"), 12 | if (i % 3 == 0, 13 | writeln("Fizz"), 14 | if (i % 5 == 0, 15 | writeln("Buzz"), 16 | writeln(i) 17 | ) 18 | ) 19 | ) 20 | ) 21 | -------------------------------------------------------------------------------- /fizzbuzz.jl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env julia 2 | 3 | # Language: Julia 4 | # Web site: https://julialang.org/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: Download and unpack https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.1-linux-x86_64.tar.gz 7 | # Install binaries in $PATH 8 | 9 | for i = 1:100 10 | if i % 15 == 0 11 | println("FizzBuzz") 12 | elseif i % 3 == 0 13 | println("Fizz") 14 | elseif i % 5 == 0 15 | println("Buzz") 16 | else 17 | println(i) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /fizzbuzz.icn: -------------------------------------------------------------------------------- 1 | # Language: Icon 2 | # Web site: https://www2.cs.arizona.edu/icon/ 3 | # Last tested on: Ubuntu 24.04.2 LTS 4 | # Requires: apt-get install iconc icont iconx 5 | 6 | procedure main() 7 | every i := 1 to 100 do { 8 | if i % 15 == 0 then { 9 | write("FizzBuzz") 10 | } 11 | else if i % 3 == 0 then { 12 | write("Fizz") 13 | } 14 | else if i % 5 == 0 then { 15 | write("Buzz") 16 | } 17 | else { 18 | write(i) 19 | } 20 | } 21 | end 22 | -------------------------------------------------------------------------------- /fizzbuzz.cr: -------------------------------------------------------------------------------- 1 | # Language: Crystal 2 | # Web site: https://crystal-lang.org/ 3 | # Last tested on: Ubuntu 24.04.2 LTS 4 | # Requires: sudo snap install --classic crystal 5 | 6 | # Note: This is identical to fizzbuzz.rb (Ruby), 7 | # but it's compiled rather than interpreted. 8 | 9 | (1..100).each do |i| 10 | puts "#{if i % 15 == 0 11 | "FizzBuzz" 12 | elsif i % 3 == 0 13 | "Fizz" 14 | elsif i % 5 == 0 15 | "Buzz" 16 | else 17 | i 18 | end}" 19 | end 20 | -------------------------------------------------------------------------------- /fizzbuzz.pas: -------------------------------------------------------------------------------- 1 | (* 2 | * Language: Pascal 3 | * Web site: https://www.freepascal.org/ 4 | * Last tested on: Ubuntu 24.04.2 LTS 5 | * Requires: apt-get install fp-compiler 6 | *) 7 | program FizzBuzz; 8 | var 9 | I: Integer; 10 | begin 11 | for I := 1 to 100 do 12 | begin 13 | if I mod 15 = 0 then 14 | writeln('FizzBuzz') 15 | else if I mod 3 = 0 then 16 | writeln('Fizz') 17 | else if I mod 5 = 0 then 18 | writeln('Buzz') 19 | else 20 | writeln(I); 21 | end; 22 | end. 23 | -------------------------------------------------------------------------------- /fizzbuzz.rs: -------------------------------------------------------------------------------- 1 | // Language: Rust 2 | // Web site: https://www.rust-lang.org/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: apt-get install rustc 5 | // OR 6 | // apt-get install rustup ; rustup default stable 7 | fn main() { 8 | for i in 1..=100 { 9 | match i % 15 { 10 | 0 => println!("FizzBuzz"), 11 | 3 | 6 | 9 | 12 => println!("Fizz"), 12 | 5 | 10 => println!("Buzz"), 13 | _ => println!("{}", i), 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /fizzbuzz.gdb: -------------------------------------------------------------------------------- 1 | # Language: gdb 2 | # Web site: https://www.gnu.org/software/gdb/ 3 | # Last tested on: Ubuntu 24.04.2 LTS 4 | # Requires: apt-get install gdb 5 | 6 | set $i = 1 7 | while $i <= 100 8 | if $i % 15 == 0 9 | echo FizzBuzz\n 10 | else 11 | if $i % 3 == 0 12 | echo Fizz\n 13 | else 14 | if $i % 5 == 0 15 | echo Buzz\n 16 | else 17 | output $i 18 | echo \n 19 | end 20 | end 21 | end 22 | set $i ++ 23 | end 24 | quit 25 | -------------------------------------------------------------------------------- /fizzbuzz.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | 22 | -------------------------------------------------------------------------------- /fizzbuzz.csh: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | # Language: csh (C shell) 4 | # Web site: https://cvsweb.openbsd.org/src/bin/csh/ 5 | # https://www.tcsh.org/ (for tcsh, an enhanced version of csh) 6 | # Last tested on: Ubuntu 24.04.2 LTS 7 | # Requires: apt-get install csh (or tcsh) 8 | 9 | @ i = 1 10 | while ($i <= 100) 11 | if ($i % 15 == 0) then 12 | echo FizzBuzz 13 | else if ($i % 3 == 0) then 14 | echo Fizz 15 | else if ($i % 5 == 0) then 16 | echo Buzz 17 | else 18 | echo $i 19 | endif 20 | @ i++ 21 | end 22 | -------------------------------------------------------------------------------- /fizzbuzz.curl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/curl https://raw.githubusercontent.com/Keith-S-Thompson/fizzbuzz-polyglot/master/expected-output.txt 2 | 3 | # Language: curl 4 | # Web site: https://curl.se/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: apt-get install curl 7 | 8 | # NOTE: This is cheating; "curl" is not really a scripting language, 9 | # This depends on the existence of the expected-output.txt file 10 | # (provided with this project) at the specified location. 11 | 12 | # NOTE: These lines are ignored; /usr/bin/curl is invoked with the 13 | # argument given on the #! line. 14 | -------------------------------------------------------------------------------- /fizzbuzz.rc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rc 2 | 3 | # Language: rc (Plan 9 shell) 4 | # Web site: http://plan9.bell-labs.com/sys/doc/rc.html # site no longer exists 5 | # Web site: https://github.com/rakitzis/rc 6 | # Last tested on: Ubuntu 24.04.2 LTS 7 | # Requires: apt-get install rc 8 | 9 | for ( i in `{seq 100} ) { 10 | if ( test `{expr $i % 15} -eq 0 ) { 11 | echo FizzBuzz 12 | } else if ( test `{expr $i % 3} -eq 0 ) { 13 | echo Fizz 14 | } else if ( test `{expr $i % 5} -eq 0 ) { 15 | echo Buzz 16 | } else { 17 | echo $i 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fizzbuzz.myr: -------------------------------------------------------------------------------- 1 | /* 2 | * Language: Myrddin 3 | * Web site: https://myrlang.org/ 4 | * Last tested on: Ubuntu 24.04.2 LTS 5 | * Requires: git clone https://github.com/oridb/mc 6 | * Install from source 7 | */ 8 | 9 | use std 10 | const main = { 11 | var i 12 | for i = 1; i <= 100; i++ 13 | if i % 15 == 0 14 | std.put("FizzBuzz\n") 15 | elif i % 3 == 0 16 | std.put("Fizz\n") 17 | elif i % 5 == 0 18 | std.put("Buzz\n") 19 | else 20 | std.put("{}\n", i) 21 | ;; 22 | ;; 23 | } 24 | -------------------------------------------------------------------------------- /fizzbuzz.vala: -------------------------------------------------------------------------------- 1 | // Language: Vala 2 | // Web site: https://wiki.gnome.org/Projects/Vala 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: apt-get install valac 5 | 6 | void main() { 7 | for (var i = 1; i <= 100; i ++) { 8 | if (i % 15 == 0) { 9 | stdout.printf("FizzBuzz\n"); 10 | } 11 | else if (i % 3 == 0) { 12 | stdout.printf("Fizz\n"); 13 | } 14 | else if (i % 5 == 0) { 15 | stdout.printf("Buzz\n"); 16 | } 17 | else { 18 | stdout.printf("%d\n", i); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fizzbuzz.gravity: -------------------------------------------------------------------------------- 1 | // Language: Gravity 2 | // Web site: https://marcobambini.github.io/gravity/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: Clone git repo, install from source 5 | // Currently using Gravity 0.5.0 6 | 7 | func main() { 8 | for (var i in 1...100) { 9 | if (i % 15 == 0) { 10 | System.print("FizzBuzz"); 11 | } else if (i % 3 == 0) { 12 | System.print("Fizz"); 13 | } else if (i % 5 == 0) { 14 | System.print("Buzz"); 15 | } else { 16 | System.print(i) 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fizzbuzz.py2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | # Language: Python 2 4 | # Web site: https://www.python.org/ 5 | # https://github.com/python/cpython 6 | # Last tested on: Ubuntu 24.04.2 LTS 7 | # Requires: Build python-2.7.18 from source (tag "v2.7.18") 8 | # (The "python2" package is no longer available on recent 9 | # versions of Ubuntu.) 10 | 11 | for i in xrange(1, 101): 12 | if i % 15 == 0: 13 | print "FizzBuzz" 14 | elif i % 3 == 0: 15 | print "Fizz" 16 | elif i % 5 == 0: 17 | print "Buzz" 18 | else: 19 | print i 20 | -------------------------------------------------------------------------------- /fizzbuzz.hodor: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env hodor 2 | 3 | # Language: Hodor 4 | # Web site: https://github.com/Keith-S-Thompson/hodor 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: Not available as an Ubuntu package; install the 7 | # "fizzbuzz" command from the GitHub project 8 | 9 | HodOR HoDor HoDOr hoDOrhoDorhoDOrhoDoRhoDoR 10 | HoDoR HoDor hodOR hoDOrhOdOr hODOR hoDoR 11 | HoDOR hodOr 12 | HodoR HoDor hodOR hOdor hODOR hoDoR 13 | HoDOR hodoR 14 | HodoR HoDor hodOR hOdOr hODOR hoDoR 15 | HoDOR hodor 16 | Hodor 17 | HoDOR HoDor 18 | HodOr 19 | HodOr 20 | -------------------------------------------------------------------------------- /fizzbuzz.nqp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/nqp 2 | 3 | # Language: NQP ("Not Quite Perl") 4 | # Web site: https://github.com/perl6/nqp 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: apt-get install nqp 7 | 8 | my $i := 1; 9 | while $i <= 100 { 10 | if $i % 15 == 0 { 11 | say("FizzBuzz"); 12 | } 13 | else { 14 | if $i % 3 == 0 { 15 | say("Fizz"); 16 | } 17 | else { 18 | if $i % 5 == 0 { 19 | say("Buzz"); 20 | } 21 | else { 22 | say($i); 23 | } 24 | } 25 | } 26 | $i++; 27 | } 28 | -------------------------------------------------------------------------------- /fizzbuzz.v: -------------------------------------------------------------------------------- 1 | // Language: V 2 | // Web site: https://vlang.io/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: Clone git repo https://github.com/vlang/v 5 | // Build `v` executable using `make` and install in $PATH 6 | 7 | fn main() { 8 | for i := 1; i <= 100; i++ { 9 | if i % 15 == 0 { 10 | println("FizzBuzz") 11 | } 12 | else if i % 3 == 0 { 13 | println("Fizz") 14 | } 15 | else if i % 5 == 0 { 16 | println("Buzz") 17 | } 18 | else { 19 | println(i) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fizzbuzz.clisp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clisp 2 | 3 | ; Language: Common Lisp 4 | ; Web site: https://common-lisp.net/ 5 | ; Last tested on: Ubuntu 24.04.2 LTS 6 | ; Requires: apt-get install clisp 7 | 8 | (defun lines (n) 9 | "Print lines from 1 to n" 10 | (cond ((< n 1) nil) 11 | (t (lines (1- n))(line n)) 12 | ) 13 | ) 14 | 15 | (defun line (n) 16 | "Print a single line" 17 | (cond ((= (mod n 15) 0) (format t "FizzBuzz~%")) 18 | ((= (mod n 3) 0) (format t "Fizz~%")) 19 | ((= (mod n 5) 0) (format t "Buzz~%")) 20 | (t (format t "~a~%" n)) 21 | ) 22 | ) 23 | 24 | (lines 100) 25 | -------------------------------------------------------------------------------- /fizzbuzz.aribas: -------------------------------------------------------------------------------- 1 | #!/usr/bin/aribas -q 2 | 3 | (* 4 | * Language: Aribas 5 | * Web site: https://www.mathematik.uni-muenchen.de/~forster/sw/aribas.html 6 | * Last tested on: Ubuntu 24.04.2 LTS 7 | * Requires: apt-get install aribas 8 | *) 9 | 10 | for i := 1 to 100 do 11 | if i mod 15 = 0 then 12 | writeln("FizzBuzz") 13 | else 14 | if i mod 3 = 0 then 15 | writeln("Fizz") 16 | else 17 | if i mod 5 = 0 then 18 | writeln("Buzz") 19 | else 20 | writeln(i) 21 | end 22 | end 23 | end 24 | end 25 | exit 26 | -------------------------------------------------------------------------------- /fizzbuzz.cpp: -------------------------------------------------------------------------------- 1 | // Language: C++ 2 | // Web site: https://www.open-std.org/JTC1/SC22/WG21/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: The "g++" package is pre-installed 5 | 6 | #include 7 | int main() { 8 | for (int i = 1; i <= 100; i ++) { 9 | if (i % 15 == 0) { 10 | std::cout << "FizzBuzz\n"; 11 | } 12 | else if (i % 3 == 0) { 13 | std::cout << "Fizz\n"; 14 | } 15 | else if (i % 5 == 0) { 16 | std::cout << "Buzz\n"; 17 | } 18 | else { 19 | std::cout << i << "\n"; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fizzbuzz.picolisp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/picolisp 2 | 3 | ; Language: PicoLisp 4 | ; Web site: https://picolisp.com/ 5 | ; Last tested on: Ubuntu 24.04.2 LTS 6 | ; Requires: apt-get install picolisp 7 | 8 | (de print_lines (n) 9 | "Print lines from 1 to n" 10 | (cond ((< n 1) nil) 11 | (t (print_lines (- n 1))(print_line n)) 12 | ) 13 | ) 14 | 15 | (de print_line (n) 16 | "Print a single line" 17 | (cond ((= (% n 15) 0) (prinl "FizzBuzz")) 18 | ((= (% n 3) 0) (prinl "Fizz")) 19 | ((= (% n 5) 0) (prinl "Buzz")) 20 | (t (prinl n)) 21 | ) 22 | ) 23 | 24 | (print_lines 100) 25 | 26 | (bye) 27 | -------------------------------------------------------------------------------- /fizzbuzz.erl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/escript 2 | 3 | % Language: Erlang 4 | % Web site: https://www.erlang.org/ 5 | % Last tested on: Ubuntu 24.04.2 LTS 6 | % Requires: apt-get install erlang 7 | 8 | print_line(N) when N rem 15 == 0 -> 9 | io:format("FizzBuzz\n"); 10 | print_line(N) when N rem 3 == 0 -> 11 | io:format("Fizz\n"); 12 | print_line(N) when N rem 5 == 0 -> 13 | io:format("Buzz\n"); 14 | print_line(N) -> 15 | io:format("~w\n", [N]). 16 | 17 | print_lines(X, Y) when Y >= X -> 18 | print_line(X), 19 | print_lines(X+1, Y); 20 | print_lines(_, _) -> 21 | done. 22 | 23 | main(_) -> 24 | print_lines(1, 100). 25 | -------------------------------------------------------------------------------- /fizzbuzz.lua: -------------------------------------------------------------------------------- 1 | #!/usr/bin/lua 2 | 3 | -- Language: Lua 4 | -- Web site: http://www.lua.org/ 5 | -- Last tested on: Ubuntu 24.04.2 LTS 6 | -- Requires: apt-get install lua5.3 7 | -- update-alternatives --install /usr/bin/lua lua-interpreter /usr/bin/lua5.3 90 8 | -- update-alternatives --install /usr/bin/luac lua-compiler /usr/bin/luac5.3 90 9 | 10 | for i = 1, 100 do 11 | if i % 15 == 0 then 12 | print("FizzBuzz") 13 | elseif i % 3 == 0 then 14 | print("Fizz") 15 | elseif i % 5 == 0 then 16 | print("Buzz") 17 | else 18 | print(i) 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /fizzbuzz.pike: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pike 2 | 3 | // Language: Pike 4 | // Web site: https://pike.lysator.liu.se/ 5 | // Last tested on: Ubuntu 24.04.2 LTS 6 | // Requires: Download https://pike.lysator.liu.se/pub/pike/latest-stable/Pike-v8.0.1738.tar.gz 7 | // Build and install from source 8 | // 9 | 10 | int main() { 11 | for (int i = 1; i <= 100; i ++) { 12 | if (i % 15 == 0) { write("FizzBuzz\n"); } 13 | else if (i % 3 == 0) { write("Fizz\n"); } 14 | else if (i % 5 == 0) { write("Buzz\n"); } 15 | else { write(i + "\n"); } 16 | } 17 | return 0; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /fizzbuzz.st: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S gst -g 2 | 3 | " 4 | Language: Smalltalk 5 | Web site: https://www.gnu.org/software/smalltalk/ 6 | Last tested on: Ubuntu 24.04.2 LTS 7 | Requires: apt-get install gnu-smalltalk (previously called gst) 8 | " 9 | 10 | 1 to: 100 do: [ :i | 11 | i \\ 15 = 0 12 | ifTrue: [ 'FizzBuzz' displayOn: stdout. stdout nl ] 13 | ifFalse: [ 14 | i \\ 3 = 0 15 | ifTrue: [ 'Fizz' displayOn: stdout. stdout nl ] 16 | ifFalse: [ 17 | i \\ 5 = 0 18 | ifTrue: [ 'Buzz' displayOn: stdout. stdout nl ] 19 | ifFalse: [ i printNl ] 20 | ] 21 | ] 22 | ] 23 | -------------------------------------------------------------------------------- /fizzbuzz.a68: -------------------------------------------------------------------------------- 1 | #!/usr/bin/a68g 2 | COMMENT 3 | Language: Algol 68 4 | Web site: http://www.algol68.org/ 5 | Last tested on: Ubuntu 24.04.2 LTS 6 | Requires: apt-get install algol68g 7 | COMMENT 8 | 9 | ( PROC width = (INT x) INT: (x > 99 | 3 | (x>9 | 2 | 1)) 10 | ; 11 | 12 | FOR i FROM 1 TO 100 13 | DO 14 | IF i MOD 15 = 0 THEN 15 | printf (( $ "FizzBuzz" l $ )) 16 | ELIF i MOD 3 = 0 THEN 17 | printf (( $ "Fizz" l $ )) 18 | ELIF i MOD 5 = 0 THEN 19 | printf (( $ "Buzz" l $ )) 20 | ELSE 21 | printf (( $ n(width(i))d l $, i )) 22 | FI 23 | OD 24 | ) 25 | -------------------------------------------------------------------------------- /fizzbuzz.awk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/awk -f 2 | 3 | # Language: Awk 4 | # Web site: https://invisible-island.net/mawk/ 5 | # https://www.gnu.org/software/gawk/ 6 | # Last tested on: Ubuntu 24.04.2 LTS 7 | # Requires: The "gawk" (GNU awk) and "mawk" packages are pre-installed. 8 | 9 | BEGIN { 10 | for (i = 1; i <= 100; i ++) { 11 | if (i % 15 == 0) { 12 | print "FizzBuzz" 13 | } 14 | else if (i % 3 == 0) { 15 | print "Fizz" 16 | } 17 | else if (i % 5 == 0) { 18 | print "Buzz" 19 | } 20 | else { 21 | print i 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fizzbuzz.adb: -------------------------------------------------------------------------------- 1 | -- Language: Ada 2 | -- Web site: https://www.adaic.org/ 3 | -- Last tested on: Ubuntu 24.04.2 LTS 4 | -- Requires: apt-get install gnat 5 | 6 | with Ada.Text_IO; use Ada.Text_IO; 7 | with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; 8 | procedure FizzBuzz is 9 | begin 10 | for I in 1 .. 100 loop 11 | if I mod 15 = 0 then 12 | Put_Line("FizzBuzz"); 13 | elsif I mod 3 = 0 then 14 | Put_Line("Fizz"); 15 | elsif I mod 5 = 0 then 16 | Put_Line("Buzz"); 17 | else 18 | Put(I, Width => 0); 19 | New_Line; 20 | end if; 21 | end loop; 22 | end FizzBuzz; 23 | -------------------------------------------------------------------------------- /fizzbuzz.wren: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env wren 2 | 3 | // Language: Wren 4 | // Web site: https://wren.io/ 5 | // Last tested on: Ubuntu 24.04.2 LTS 6 | // Requires: Install from source: 7 | // git clone https://github.com/munificent/wren 8 | // cd wren 9 | // make 10 | // copy `wren` to a directory in $PATH 11 | 12 | for (i in 1..100) { 13 | if (i % 15 == 0) { 14 | System.print("FizzBuzz") 15 | } else if (i % 3 == 0) { 16 | System.print("Fizz") 17 | } else if (i % 5 == 0) { 18 | System.print("Buzz") 19 | } else { 20 | System.print("%(i)") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fizzbuzz.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Language: C 3 | * Web site: https://www.open-std.org/JTC1/SC22/WG14/ 4 | * https://gcc.gnu.org/ 5 | * Last tested on: Ubuntu 24.04.2 LTS 6 | * Requires: The "gcc" package is pre-installed 7 | */ 8 | 9 | #include 10 | int main(void) { 11 | for (int i = 1; i <= 100; i ++) { 12 | if (i % 15 == 0) { 13 | puts("FizzBuzz"); 14 | } 15 | else if (i % 3 == 0) { 16 | puts("Fizz"); 17 | } 18 | else if (i % 5 == 0) { 19 | puts("Buzz"); 20 | } 21 | else { 22 | printf("%d\n", i); 23 | } 24 | } 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /fizzbuzz.pure: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pure 2 | 3 | // Language: Pure 4 | // Web site: https://purelang.bitbucket.io/ 5 | // Last tested on: Ubuntu 24.04.2 LTS 6 | // https://bitbucket.org/purelang/pure-lang/issues/36/port-pure-to-the-mcjit-in-order-to-support 7 | // Requires: Build from source 8 | // Currently using Pure 0.64 9 | 10 | // See https://github.com/agraef/pure-lang/wiki/PureOnDebian 11 | 12 | using system; 13 | 14 | print_line n::int = puts "FizzBuzz" if n mod 15 == 0; 15 | = puts "Fizz" if n mod 3 == 0; 16 | = puts "Buzz" if n mod 5 == 0; 17 | = printf "%d\n" n; 18 | 19 | map print_line (1..100); 20 | -------------------------------------------------------------------------------- /fizzbuzz.lily: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env lily 2 | 3 | # Language: Lily 4 | # Web site: https://github.com/FascinatedBox/lily 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: Install from source: 7 | # git clone https://github.com/FascinatedBox/lily 8 | # cmake -DCMAKE_INSTALL_PREFIX=<...> 9 | # make 10 | # make install 11 | # Currently using revision 204980004a 2018-05-08 (version 1.4 +) 12 | 13 | for i in 1...100: { 14 | if i % 15 == 0: { 15 | print("FizzBuzz") 16 | elif i % 3 == 0: 17 | print("Fizz") 18 | elif i % 5 == 0: 19 | print("Buzz") 20 | else: 21 | print(i) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fizzbuzz.vb: -------------------------------------------------------------------------------- 1 | ' Language: Visual Basic .NET 2 | ' Web site: https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/ 3 | ' Last tested on: Ubuntu 24.04.2 LTS 4 | ' Requires: apt-get install mono-vbnc 5 | 6 | Module FizzBuzz 7 | Sub Main() 8 | Dim I As Integer 9 | For I = 1 to 100 10 | If I mod 15 = 0 Then 11 | Console.WriteLine("FizzBuzz") 12 | ElseIf I mod 3 = 0 Then 13 | Console.WriteLine("Fizz") 14 | ElseIf I mod 5 = 0 Then 15 | Console.WriteLine("Buzz") 16 | Else 17 | Console.WriteLine(I) 18 | End If 19 | Next 20 | End Sub 21 | End Module 22 | -------------------------------------------------------------------------------- /fizzbuzz.elisp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/emacs --script 2 | 3 | ; Language: Emacs Lisp 4 | ; Web site: https://www.gnu.org/software/emacs/ 5 | ; Last tested on: Ubuntu 24.04.2 LTS 6 | ; Requires: apt-get install emacs 7 | ; (The verify script filters out messages written to stderr.) 8 | 9 | (defun lines (n) 10 | "Print lines from 1 to n" 11 | (cond ((< n 1) nil) 12 | (t (lines (1- n))(line n)) 13 | ) 14 | ) 15 | 16 | (defun line (n) 17 | "Print a single line" 18 | (cond ((= (mod n 15) 0) (princ "FizzBuzz\n")) 19 | ((= (mod n 3) 0) (princ "Fizz\n")) 20 | ((= (mod n 5) 0) (princ "Buzz\n")) 21 | (t (princ n) (princ "\n")) 22 | ) 23 | ) 24 | 25 | (lines 100) 26 | -------------------------------------------------------------------------------- /fizzbuzz.fs: -------------------------------------------------------------------------------- 1 | #! /usr/bin/gforth 2 | 3 | \ Language: Forth 4 | \ Web site: http://www.forth.org/ 5 | \ https://www.gnu.org/software/gforth/ 6 | \ Last tested on: Ubuntu 24.04.2 LTS 7 | \ Requires: apt-get install gforth 8 | 9 | : fizzbuzz ( -- ) 10 | 1 11 | 101 1 ?do 12 | dup 15 mod 0= if 13 | ." FizzBuzz" cr 14 | else 15 | dup 3 mod 0= if 16 | ." Fizz" cr 17 | else 18 | dup 5 mod 0= if 19 | ." Buzz" cr 20 | else 21 | dup 1 .r cr 22 | then 23 | then 24 | then 25 | 1+ 26 | loop 27 | drop 28 | ; 29 | fizzbuzz 30 | bye 31 | -------------------------------------------------------------------------------- /fizzbuzz.java: -------------------------------------------------------------------------------- 1 | // Language: Java 2 | // Web site: http://www.java.com/ 3 | // Last tested on: Ubuntu 24.04.2 LTS1 4 | // Requires: apt-get install openjdk-11-jdk-headless:amd64 5 | 6 | public class fizzbuzz { 7 | public static final void main( String args[] ) { 8 | for (int i = 1; i <= 100; i ++) { 9 | if (i % 15 == 0) { 10 | System.out.println("FizzBuzz"); 11 | } 12 | else if (i % 3 == 0) { 13 | System.out.println("Fizz"); 14 | } 15 | else if (i % 5 == 0) { 16 | System.out.println("Buzz"); 17 | } 18 | else { 19 | System.out.println(i); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /fizzbuzz.dart: -------------------------------------------------------------------------------- 1 | #!/usr/bin/dart 2 | 3 | // Language: Dart 4 | // Web site: https://www.dartlang.org/ 5 | // Last tested on: Ubuntu 24.04.2 LTS 6 | // Requires: Download https://storage.googleapis.com/dart-archive/channels/stable/release/latest/linux_packages/debian_wheezy/dart_1.20.1-1_amd64.deb 7 | // dpkg -i dart_1.20.1-1_amd64.deb 8 | 9 | void main() { 10 | for (var i = 1; i <= 100; i ++) { 11 | if (i % 15 == 0) { 12 | print("FizzBuzz"); 13 | } 14 | else if (i % 3 == 0) { 15 | print("Fizz"); 16 | } 17 | else if (i % 5 == 0) { 18 | print("Buzz"); 19 | } 20 | else { 21 | print(i); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fizzbuzz.gpt: -------------------------------------------------------------------------------- 1 | // Language: G-Portugol 2 | // Web site: https://sourceforge.net/projects/gpt.berlios/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: apt-get install gpt 5 | 6 | algoritmo fizzbuzz; 7 | 8 | variáveis 9 | i : inteiro; 10 | fim-variáveis 11 | 12 | início 13 | para i de 1 até 100 faça 14 | se i % 15 = 0 então 15 | imprima("FizzBuzz"); 16 | senão 17 | se i % 3 = 0 então 18 | imprima("Fizz"); 19 | senão 20 | se i % 5 = 0 então 21 | imprima("Buzz"); 22 | senão 23 | imprima(i); 24 | fim-se 25 | fim-se 26 | fim-se 27 | fim-para 28 | fim 29 | -------------------------------------------------------------------------------- /fizzbuzz.sd7: -------------------------------------------------------------------------------- 1 | (* 2 | * Language: Seed7 3 | * Web site: https://seed7.sourceforge.net/ 4 | * Web site: https://github.com/ThomasMertes/seed7 5 | * Last tested on: Ubuntu 24.04.2 LTS 6 | * Requires: Clone the repo, follow build instructions in read_me.txt 7 | *) 8 | 9 | $ include "seed7_05.s7i"; 10 | include "stdio.s7i"; 11 | 12 | const proc: main is func 13 | local 14 | var integer: i is 0; 15 | begin 16 | for i range 1 to 100 do 17 | if i mod 15 = 0 then 18 | writeln("FizzBuzz"); 19 | elsif i mod 3 = 0 then 20 | writeln("Fizz"); 21 | elsif i mod 5 = 0 then 22 | writeln("Buzz"); 23 | else 24 | writeln(i); 25 | end if; 26 | end for; 27 | end func; 28 | -------------------------------------------------------------------------------- /fizzbuzz.guile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/guile --no-auto-compile 2 | !# 3 | 4 | ; Language: Guile 5 | ; Web site: https://www.gnu.org/software/guile/ 6 | ; Last tested on: Ubuntu 24.04.2 LTS 7 | ; Requires: apt-get install guile-2.0 8 | 9 | (define line 10 | (lambda (n) 11 | (cond ((= (modulo n 15) 0) (display "FizzBuzz") (newline)) 12 | ((= (modulo n 3) 0) (display "Fizz") (newline)) 13 | ((= (modulo n 5) 0) (display "Buzz") (newline)) 14 | (else (display n) (newline))))) 15 | 16 | (define fizzbuzz 17 | (lambda (first last) 18 | (cond ((> first last) ) 19 | (else (line first) 20 | (fizzbuzz (+ first 1) last))))) 21 | 22 | (fizzbuzz 1 100) 23 | -------------------------------------------------------------------------------- /fizzbuzz.l: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env L 2 | 3 | // Language: Little 4 | // Web site: https://www.little-lang.org/ 5 | // Last tested on: Ubuntu 24.04.2 LTS 6 | // Requires: git clone --recursive https://github.com/bitkeeper-scm/little-lang.git 7 | // make && make PREFIX=... install 8 | // apt-get install libxft-dev 9 | 10 | void main(void) { 11 | int i; 12 | for (i = 1; i <= 100; i ++) { 13 | if (i % 15 == 0) { 14 | puts("FizzBuzz"); 15 | } 16 | else if (i % 3 == 0) { 17 | puts("Fizz"); 18 | } 19 | else if (i % 5 == 0) { 20 | puts("Buzz"); 21 | } 22 | else { 23 | printf("%d\n", i); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fizzbuzz.go: -------------------------------------------------------------------------------- 1 | // Language: go 2 | // Web site: https://go.dev/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: apt-get install golang 5 | 6 | // NOTE: The above currently installs Go version 1.6.1. 7 | // The latest version is 1.7.3, installable from 8 | // https://storage.googleapis.com/golang/go1.7.3.linux-amd64.tar.gz 9 | 10 | package main 11 | 12 | import "fmt" 13 | 14 | func main() { 15 | for i := 1; i <= 100; i ++ { 16 | if i % 15 == 0 { 17 | fmt.Println("FizzBuzz") 18 | } else if i % 3 == 0 { 19 | fmt.Println("Fizz") 20 | } else if i % 5 == 0 { 21 | fmt.Println("Buzz") 22 | } else { 23 | fmt.Printf("%d\n", i) 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fizzbuzz.vg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env vigil 2 | 3 | # Language: Vigil 4 | # Web site: https://github.com/munificent/vigil 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: Install interpreter from git repo 7 | 8 | def fizzbuzz_line(n): 9 | """ 10 | Returns the contents of the nth line of the output for FizzBuzz 11 | """ 12 | implore isinstance(n, int) and n >= 1 and n <= 100 13 | if n % 15 == 0: 14 | result = "FizzBuzz" 15 | elif n % 3 == 0: 16 | result = "Fizz" 17 | elif n % 5 == 0: 18 | result = "Buzz" 19 | else: 20 | result = n 21 | 22 | swear result == n or result.find("zz") != -1 23 | return result 24 | 25 | def main(): 26 | for n in range(1, 101): 27 | print(fizzbuzz_line(n)) 28 | -------------------------------------------------------------------------------- /fizzbuzz.f90: -------------------------------------------------------------------------------- 1 | ! Language: Fortran 90 2 | ! Web site: https://gcc.gnu.org/wiki/GFortran (for the GNU implementation) 3 | ! Last tested on: Ubuntu 24.04.2 LTS 4 | ! Requires: apt-get install gfortran 5 | 6 | program FizzBuzz 7 | implicit none 8 | integer i 9 | 10 | do i = 1, 100 11 | 12 | if (mod(i, 15) .eq. 0) then 13 | print '(a)', 'FizzBuzz' 14 | else if (mod(i, 3) .eq. 0) then 15 | print '(a)', 'Fizz' 16 | else if (mod(i, 5) .eq. 0) then 17 | print '(a)', 'Buzz' 18 | else if (i .lt. 10) then 19 | print '(i1)', i 20 | else 21 | print '(i2)', i 22 | end if 23 | 24 | end do 25 | 26 | end 27 | -------------------------------------------------------------------------------- /fizzbuzz.zig: -------------------------------------------------------------------------------- 1 | // Language: Zig 2 | // Web site: https://ziglang.org/ 3 | // Last tested on: Ubuntu 22.04.3 4 | // Requires: sudo snap install --beta --classic zig 5 | // (Installs zig 0.13.0) 6 | 7 | const std = @import("std"); 8 | 9 | pub fn main() !void { 10 | const stdout = std.io.getStdOut().writer(); 11 | var i: u32 = 1; 12 | while (i <= 100) : (i += 1) { 13 | if (i % 15 == 0) { 14 | try stdout.writeAll("FizzBuzz\n"); 15 | } 16 | else if (i % 3 == 0) { 17 | try stdout.writeAll("Fizz\n"); 18 | } 19 | else if (i % 5 == 0) { 20 | try stdout.writeAll("Buzz\n"); 21 | } 22 | else { 23 | try stdout.print("{d}\n", .{i}); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fizzbuzz.nodejs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/node 2 | 3 | // Language: Node.js (JavaScript) 4 | // Web site: http://nodejs.org/ 5 | // Last tested on: Ubuntu 24.04.2 LTS 6 | // Requires: apt-get install nodejs nodejs-legacy curl 7 | 8 | // Note: The "nodejs-legacy" creates /usr/bin/node as a symlink to nodejs. 9 | 10 | var http = require('http') 11 | 12 | http.createServer(function (request, response) { 13 | response.writeHead(200, {'Content-Type': 'text/plain'}) 14 | for (var i = 1; i <= 100; i ++) { 15 | response.write(i % 15 == 0 ? "FizzBuzz\n" : 16 | i % 3 == 0 ? "Fizz\n" : 17 | i % 5 == 0 ? "Buzz\n" : 18 | i.toString() + "\n") 19 | } 20 | response.end() 21 | process.exit() 22 | }).listen(9000) 23 | -------------------------------------------------------------------------------- /fizzbuzz.ps: -------------------------------------------------------------------------------- 1 | % Usage: gs -q -dNODISPLAY fizzbuzz.ps 2 | 3 | % Language: PostScript 4 | % Web site: https://www.adobe.com/products/postscript/ 5 | % Web site: https://www.ghostscript.com/ 6 | % Last tested on: Ubuntu 24.04.2 LTS 7 | % Requires: apt-get install ghostscript 8 | 9 | 1 10 | 100 { 11 | dup 15 div dup floor eq 12 | { (FizzBuzz) } 13 | { 14 | dup 3 div dup floor eq 15 | { (Fizz) } 16 | { 17 | dup 5 div dup floor eq 18 | { (Buzz) } 19 | { dup 3 string cvs } 20 | ifelse 21 | } 22 | ifelse 23 | } 24 | ifelse 25 | print (\n) print 26 | 27 | 1 add 28 | } repeat 29 | 30 | quit 31 | -------------------------------------------------------------------------------- /fizzbuzz.pli: -------------------------------------------------------------------------------- 1 | /* Language: PL/I 2 | * Web site: http://www.iron-spring.com/ 3 | * Last tested on: Ubuntu 24.04.2 LTS 4 | * Requires: Install from source, pli-0.9.10c.tar.gz 5 | * NOTE: Compile and link commands in the `verify` script are derived from samples/Makefile.Linux 6 | */ 7 | 8 | fizzbuzz: proc options(main); 9 | dcl i fixed dec(3); 10 | on endpage (Sysprint); 11 | do i = 1 to 100; 12 | if mod(i, 15) = 0 then 13 | put ('FizzBuzz'); 14 | else if mod(i, 3) = 0 then 15 | put ('Fizz'); 16 | else if mod(i, 5) = 0 then 17 | put ('Buzz'); 18 | else if i < 10 then 19 | put edit(i)(p'9'); 20 | else 21 | put edit(i)(p'z9'); 22 | put skip; 23 | end; 24 | end fizzbuzz; 25 | -------------------------------------------------------------------------------- /fizzbuzz.setl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env setl 2 | 3 | -- Language: SETL 4 | -- Web site: https://setl.org/setl/ 5 | -- Last tested on: Ubuntu 24.04.2 LTS 6 | -- Requires: Install precompiled executables from 7 | -- https://setl.org/setl/bin/Linux-x86-64bit/ 8 | 9 | program Fizz_Buzz; 10 | fizz := {3, 6..100}; 11 | buzz := {5, 10..100}; 12 | fizzbuzz := fizz * buzz; 13 | fizz -:= fizzbuzz; 14 | buzz -:= fizzbuzz; 15 | num := {1..100} - fizz - buzz - fizzbuzz; 16 | line_map := {[n, "Fizz"] : n in fizz} + 17 | {[n, "Buzz"] : n in buzz} + 18 | {[n, "FizzBuzz"] : n in fizzbuzz} + 19 | {[n, n] : n in num}; 20 | loop for i in [1..100] do 21 | print(line_map(i)); 22 | end loop; 23 | end Fizz_Buzz; 24 | -------------------------------------------------------------------------------- /fizzbuzz.cs: -------------------------------------------------------------------------------- 1 | // Language: C# 2 | // Web site: http://www.ecma-international.org/publications/standards/Ecma-334.htm 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: apt-get mono-xbuild mono-mcs mono-devel 5 | // (was apt-get install mono-gmcs) 6 | 7 | using System; 8 | class FizzBuzz { 9 | static void Main() { 10 | for (int n = 1; n <= 100; n ++) { 11 | if (n % 15 == 0) { 12 | Console.WriteLine("FizzBuzz"); 13 | } 14 | else if (n % 3 == 0) { 15 | Console.WriteLine("Fizz"); 16 | } 17 | else if (n % 5 == 0) { 18 | Console.WriteLine("Buzz"); 19 | } 20 | else { 21 | Console.WriteLine(n); 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fizzbuzz.ratfor: -------------------------------------------------------------------------------- 1 | # Language: Ratfor 2 | # Web site: http://sepwww.stanford.edu/doku.php?id=sep:software:ratfor 3 | # Last tested on: Ubuntu 24.04.2 LTS 4 | # Requires: apt-get install f2c ratfor 5 | 6 | program fizzbuzz 7 | integer i 8 | 9 | do i = 1, 100 { 10 | if (mod(i, 15) == 0) { 11 | print '(a)', 'FizzBuzz' 12 | } 13 | else if (mod(i, 3) == 0) { 14 | print '(a)', 'Fizz' 15 | } 16 | else if (mod(i, 5) == 0) { 17 | print '(a)', 'Buzz' 18 | } 19 | else { 20 | call print_integer(i) 21 | } 22 | } 23 | 24 | end 25 | 26 | subroutine print_integer(n) 27 | integer n 28 | if (n < 10) { 29 | print '(i1)', n 30 | } 31 | else if (n < 100) { 32 | print '(i2)', n 33 | } 34 | else { 35 | print '(i3)', n 36 | } 37 | end 38 | -------------------------------------------------------------------------------- /fizzbuzz.vim: -------------------------------------------------------------------------------- 1 | " Language: Vimscript 2 | " Web site: https://www.vim.org/ 3 | " Last tested on: Ubuntu 24.04.2 LTS 4 | " Requires: apt-get install vim 5 | 6 | let i = 1 7 | while i <= 100 8 | if i % 15 == 0 9 | append 10 | FizzBuzz 11 | . 12 | elseif i % 3 == 0 13 | append 14 | Fizz 15 | . 16 | elseif i % 5 == 0 17 | append 18 | Buzz 19 | . 20 | else 21 | append 22 | i 23 | . 24 | execute "s/i/" . i 25 | endif 26 | let i += 1 27 | endwhile 28 | write fizzbuzz.vim.out 29 | quit 30 | 31 | " To echo each line in a vim session: 32 | " 33 | " for i in range(1,100) 34 | " if i % 15 == 0 35 | " echo "FizzBuzz" 36 | " elseif i % 3 == 0 37 | " echo "Fizz" 38 | " elseif i % 5 == 0 39 | " echo "Buzz" 40 | " else 41 | " echo i 42 | " endif 43 | " endfor 44 | -------------------------------------------------------------------------------- /fizzbuzz.f: -------------------------------------------------------------------------------- 1 | C Language: FORTRAN 77 2 | C Web site: https://netlib.org/f2c/ (for the f2c translator) 3 | C Last tested on: Ubuntu 24.04.2 LTS 4 | C Requires: apt-get install gfortran 5 | 6 | program FizzBuzz 7 | 8 | do 1 i = 1, 100 9 | 10 | if (mod(i, 15) .eq. 0) then 11 | print '(a)', 'FizzBuzz' 12 | goto 1 13 | end if 14 | 15 | if (mod(i, 3) .eq. 0) then 16 | print '(a)', 'Fizz' 17 | goto 1 18 | end if 19 | 20 | if (mod(i, 5) .eq. 0) then 21 | print '(a)', 'Buzz' 22 | goto 1 23 | end if 24 | 25 | if (i .lt. 10) then 26 | print '(i1)', i 27 | goto 1 28 | end if 29 | 30 | if (i .lt. 100) then 31 | print '(i2)', i 32 | goto 1 33 | end if 34 | 35 | print '(i3)', i 36 | 37 | 1 continue 38 | 39 | end 40 | -------------------------------------------------------------------------------- /fizzbuzz.scala: -------------------------------------------------------------------------------- 1 | // Language: Scala 2 | // Web site: https://www.scala-lang.org/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: apt-get install scala openjdk-8-jdk-headless:amd64 openjdk-8-jre:amd64 openjdk-8-jre-headless:amd64 5 | // (Uninstall openjdk-9 if necessary.) 6 | // NOTE: The scalac and/or scala command invokes stty, causing it to hang if stdout is not a tty. 7 | 8 | object fizzbuzz 9 | { 10 | def main(args: Array[String]) = { 11 | for (i <- (1 to 100)) { 12 | if (i % 15 == 0) { 13 | println("FizzBuzz") 14 | } 15 | else if (i % 3 == 0) { 16 | println("Fizz") 17 | } 18 | else if (i % 5 == 0) { 19 | println("Buzz") 20 | } 21 | else { 22 | println(i) 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fizzbuzz.c3: -------------------------------------------------------------------------------- 1 | // Language: C3 2 | // Web site: https://c3-lang.org/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: Install from source: 5 | // git clone https://github.com/c3lang/c3c/ 6 | // Follow build instructions in README.md 7 | // I haven't been able to build c3 on Ubuntu 24.04.2, 8 | // but I have a working v0.6.1 build created on 9 | // Ubuntu 22.04.5. 10 | 11 | module fizzbuzz; 12 | import std::io; 13 | 14 | fn void main() { 15 | for (int i = 1; i <= 100; i ++) { 16 | if (i % 15 == 0) { 17 | io::printn("FizzBuzz"); 18 | } 19 | else if (i % 3 == 0) { 20 | io::printn("Fizz"); 21 | } 22 | else if (i % 5 == 0) { 23 | io::printn("Buzz"); 24 | } 25 | else { 26 | io::printn(i); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /fizzbuzz.hx: -------------------------------------------------------------------------------- 1 | // Language: Haxe 2 | // Web site: https://haxe.org/ 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: apt-get install haxe 5 | 6 | // NOTE: Haxe requires a class name to start with an upper case letter, 7 | // and a source file name to match the class name. This conflicts with 8 | // the "fizzbuzz.*" pattern I use for source files, so the verify script 9 | // copies fizzbuzz.hx to Fizzbuzz.hx. 10 | 11 | class Fizzbuzz { 12 | static public function main():Void { 13 | for (i in 1...101) { 14 | if (i % 15 == 0) { 15 | Sys.println("FizzBuzz"); 16 | } 17 | else if (i % 3 == 0) { 18 | Sys.println("Fizz"); 19 | } 20 | else if (i % 5 == 0) { 21 | Sys.println("Buzz"); 22 | } 23 | else { 24 | Sys.println(i); 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /fizzbuzz.lol: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env lci 2 | 3 | BTW Language: LOLCODE 4 | BTW Web site: http://lolcode.org/ 5 | BTW Last tested on: Ubuntu 24.04.2 LTS 6 | BTW Requires: Install from source: https://github.com/justinmeza/lci 7 | BTW Requires cmake (apt-get install cmake) 8 | 9 | HAI 1.3 10 | IM IN YR loop UPPIN YR i WILE DIFFRINT i AN 100 11 | I HAS A counter 12 | counter R SUM OF i AN 1 13 | MOD OF counter AN 15, WTF? 14 | OMG 0 15 | VISIBLE "FizzBuzz" 16 | GTFO 17 | OMG 3 18 | OMG 6 19 | OMG 9 20 | OMG 12 21 | VISIBLE "Fizz" 22 | GTFO 23 | OMG 5 24 | OMG 10 25 | VISIBLE "Buzz" 26 | GTFO 27 | OMGWTF 28 | VISIBLE counter 29 | GTFO 30 | OIC 31 | IM OUTTA YR loop 32 | KTHXBYE 33 | -------------------------------------------------------------------------------- /fizzbuzz.sqlite3: -------------------------------------------------------------------------------- 1 | -- Language: sqlite3 (SQL) 2 | -- Web site: https://www.sqlite.org/ 3 | -- Last tested on: Ubuntu 24.04.2 LTS 4 | -- Requires: apt-get install sqlite 5 | 6 | -- Loop code based on a Stack Overflow answer by Doug Currie, 7 | -- http://stackoverflow.com/a/7373289/827263 8 | 9 | create table t (startrange int not null, endrange int not null); 10 | insert into t values(1, 100); 11 | create table lines (i int not null, s string); 12 | 13 | pragma recursive_triggers = on; 14 | create temp trigger ttrig 15 | after insert on lines 16 | when new.i < (select t.endrange from t) begin 17 | insert into lines values (new.i + 1, new.i + 1); 18 | end; 19 | 20 | insert into lines values ((select t.startrange from t), (select t.startrange from t)); 21 | update lines set s = "Fizz" where i % 3 = 0; 22 | update lines set s = "Buzz" where i % 5 = 0; 23 | update lines set s = "FizzBuzz" where i % 15 = 0; 24 | select s from lines order by i; 25 | -------------------------------------------------------------------------------- /fizzbuzz.f66: -------------------------------------------------------------------------------- 1 | C Language: FORTRAN 66 2 | C Web site: https://netlib.org/f2c/ (for the f2c translator) 3 | C Last tested on: Ubuntu 24.04.2 LTS 4 | C Requires: apt-get install gfortran 5 | 6 | C I don't have a FORTRAN 66 compiler, so I use the gfortran compiler. 7 | 8 | PROGRAM FZZBZZ 9 | 10 | DO 99 I = 1, 100 11 | 12 | IF (MOD(I, 15)) 19,10,19 13 | 10 WRITE (6, 100) 14 | GO TO 99 15 | 19 CONTINUE 16 | 17 | IF (MOD(I, 3)) 29,20,29 18 | 20 WRITE (6, 110) 19 | GO TO 99 20 | 29 CONTINUE 21 | 22 | IF (MOD(I, 5)) 39,30,39 23 | 30 WRITE (6, 120) 24 | GO TO 99 25 | 39 CONTINUE 26 | 27 | IF (I-10) 40,49,49 28 | 40 WRITE(6, 130) I 29 | GO TO 99 30 | 49 WRITE(6,140) I 31 | 32 | 99 CONTINUE 33 | 34 | 100 FORMAT (8HFizzBuzz) 35 | 110 FORMAT (4HFizz) 36 | 120 FORMAT (4HBuzz) 37 | 130 FORMAT (I1) 38 | 140 FORMAT (I2) 39 | 40 | STOP 41 | 42 | END 43 | -------------------------------------------------------------------------------- /expected-output.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | Fizz 4 | 4 5 | Buzz 6 | Fizz 7 | 7 8 | 8 9 | Fizz 10 | Buzz 11 | 11 12 | Fizz 13 | 13 14 | 14 15 | FizzBuzz 16 | 16 17 | 17 18 | Fizz 19 | 19 20 | Buzz 21 | Fizz 22 | 22 23 | 23 24 | Fizz 25 | Buzz 26 | 26 27 | Fizz 28 | 28 29 | 29 30 | FizzBuzz 31 | 31 32 | 32 33 | Fizz 34 | 34 35 | Buzz 36 | Fizz 37 | 37 38 | 38 39 | Fizz 40 | Buzz 41 | 41 42 | Fizz 43 | 43 44 | 44 45 | FizzBuzz 46 | 46 47 | 47 48 | Fizz 49 | 49 50 | Buzz 51 | Fizz 52 | 52 53 | 53 54 | Fizz 55 | Buzz 56 | 56 57 | Fizz 58 | 58 59 | 59 60 | FizzBuzz 61 | 61 62 | 62 63 | Fizz 64 | 64 65 | Buzz 66 | Fizz 67 | 67 68 | 68 69 | Fizz 70 | Buzz 71 | 71 72 | Fizz 73 | 73 74 | 74 75 | FizzBuzz 76 | 76 77 | 77 78 | Fizz 79 | 79 80 | Buzz 81 | Fizz 82 | 82 83 | 83 84 | Fizz 85 | Buzz 86 | 86 87 | Fizz 88 | 88 89 | 89 90 | FizzBuzz 91 | 91 92 | 92 93 | Fizz 94 | 94 95 | Buzz 96 | Fizz 97 | 97 98 | 98 99 | Fizz 100 | Buzz 101 | -------------------------------------------------------------------------------- /sh6-bug/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * osh - an enhanced port of the Sixth Edition (V6) UNIX Thompson shell 3 | * sh6 - an unenhanced port of the Sixth Edition (V6) UNIX Thompson shell 4 | */ 5 | /* 6 | * _XOPEN_SOURCE and/or _BSD_SOURCE and/or _DEFAULT_SOURCE should be 7 | * defined only if needed to avoid compilation errors or warnings for 8 | * the osh package on a given system. The systems where these feature 9 | * test macros are known to be needed are defined in the mkconfig script. 10 | * 11 | * This includes only Linux and SunOS (Solaris/OpenSolaris) 12 | * at the present time. 13 | * 14 | * Configured for: Linux 4.8.0-27-generic x86_64 15 | */ 16 | 17 | #ifndef CONFIG_H 18 | #define CONFIG_H 19 | 20 | #define PATH_LOGIN "/bin/login" /* Modify value if incorrect. */ 21 | #define PATH_NEWGRP "/usr/bin/newgrp" /* Modify value if incorrect. */ 22 | #define OSH_UNAME_SRM "Linux 4.8.0-27-generic x86_64" 23 | 24 | #define _XOPEN_SOURCE 600L 25 | #define _BSD_SOURCE 26 | #define _DEFAULT_SOURCE 27 | 28 | #endif /* !CONFIG_H */ 29 | -------------------------------------------------------------------------------- /fizzbuzz.b: -------------------------------------------------------------------------------- 1 | /* 2 | * Language: B 3 | * Web site: https://www.bell-labs.com/usr/dmr/www/kbman.html 4 | * Last tested on: Ubuntu 24.04.2 LTS 5 | * Requires: I've verified the program using a B compiler available 6 | * at https://github.com/Leushenko/ybc I have not yet 7 | * set up the `verify` script to use it. Instead, the 8 | * verify script filters the B source code in an ad-hoc 9 | * manner, applicable only to this specific program, 10 | * to generate valid C, which it then compiles and executes. 11 | */ 12 | 13 | main() { 14 | auto i; 15 | i = 1; 16 | while (i <= 100) { 17 | if (i % 15 == 0) { 18 | printf("FizzBuzz*n"); 19 | } 20 | else if (i % 3 == 0) { 21 | printf("Fizz*n"); 22 | } 23 | else if (i % 5 == 0) { 24 | printf("Buzz*n"); 25 | } 26 | else { 27 | printf("%d*n", i); 28 | } 29 | i ++; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /fizzbuzz.logo: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env logo 2 | 3 | ; Language: Logo 4 | ; Web site: http://ucblogo.sourceforge.net/ 5 | ; ftp://ftp.cs.berkeley.edu/pub/ucblogo/ 6 | ; https://packages.ubuntu.com/jammy/amd64/ucblogo/download 7 | ; Last tested on: Ubuntu 24.04.2 LTS 8 | ; Requires: Build from a modified version of ucblogo-5.6.tar.gz 9 | ; from the ftp site to fix a compilation error 10 | ; (replace "exp" by "Exp" *except* in math.c). 11 | ; An alternative is to download ucblogo_5.5-3_amd64.deb 12 | ; from packages.ubuntu.com "dpkg -i ucblogo_5.5-3_amd64.deb" 13 | ; On Ubuntu 17.10, `apt-get install ucblogo` installs version 6.0, 14 | ; which doesn't work without an X display. 15 | 16 | to print_line :i 17 | if [(remainder :i 15) = 0] [print "FizzBuzz stop] 18 | if [(remainder :i 3) = 0] [print "Fizz stop] 19 | if [(remainder :i 5) = 0] [print "Buzz stop] 20 | print :i 21 | end 22 | 23 | for [i 1 100 1] [print_line :i] 24 | 25 | bye 26 | -------------------------------------------------------------------------------- /fizzbuzz.sim: -------------------------------------------------------------------------------- 1 | COMMENT 2 | Language: Simula 3 | Web site: http://www.simula67.info/ 4 | Last tested on: Ubuntu 24.04.2 LTS 5 | Requires: Install from source, http://simula67.at.ifi.uio.no/Cim/cim-3.37.tar.gz 6 | Building with default options results in a segmentation fault running the "cim" command. 7 | It works if I build with CFLAGS=-m32, making "cim" an x86 binary. 8 | ; 9 | 10 | begin 11 | integer i; 12 | for i:= 1 step 1 until 100 do 13 | begin 14 | if (i // 15 * 15 = i) then 15 | begin 16 | OutText("FizzBuzz"); 17 | end 18 | else if (i // 3 * 3 = i) then 19 | begin 20 | OutText("Fizz"); 21 | end 22 | else if (i // 5 * 5 = i) then 23 | begin 24 | OutText("Buzz"); 25 | end 26 | else 27 | begin 28 | integer width; 29 | width := 1; 30 | if (i >= 10) then width := 2; 31 | if (i = 100) then width := 3; 32 | OutInt(i, width); 33 | end; 34 | OutImage; 35 | end; 36 | end; 37 | -------------------------------------------------------------------------------- /fizzbuzz.m: -------------------------------------------------------------------------------- 1 | // Language: Objective-C 2 | // Web site: https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html 3 | // Last tested on: Ubuntu 24.04.2 LTS 4 | // Requires: apt-get install gobjc libgnustep-base-dev 5 | 6 | // Note: The use of Objective-C's object-oriented features (creating 7 | // and destroying a Num object for each line) is entirely gratuitous, 8 | // intended to distinguish this program from a pure C version. 9 | 10 | #import 11 | #import 12 | 13 | @interface Num:NSObject { 14 | int value; 15 | } 16 | -(Num*)set:(int)n; 17 | -(Num*)print; 18 | @end 19 | 20 | @implementation Num 21 | -(Num*)set:(int)n { 22 | value = n; 23 | return self; 24 | } 25 | -(Num*)print { 26 | if (value % 15 == 0) { puts("FizzBuzz"); } 27 | else if (value % 3 == 0) { puts("Fizz"); } 28 | else if (value % 5 == 0) { puts("Buzz"); } 29 | else { printf("%d\n", value); } 30 | return self; 31 | } 32 | @end 33 | 34 | int main(void) { 35 | for (int i = 1; i <= 100; i ++) { 36 | [[[[Num alloc] set : i] print] release]; 37 | } 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /install-prereqs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script installs the prerequisites for *most* of these 4 | # programs on a Debian or derived system. 5 | # 6 | # In a test on a freshly configured Ubuntu 14.04 system, 7 | # 57 out of 72 tests passed. The failing tests were: 8 | # fizzbuzz.crystal 9 | # fizzbuzz.fizzbuzz 10 | # fizzbuzz.groovy 11 | # fizzbuzz.hodor 12 | # fizzbuzz.icn 13 | # fizzbuzz.lol 14 | # fizzbuzz.mod 15 | # fizzbuzz.nim 16 | # fizzbuzz.nodejs 17 | # fizzbuzz.pike 18 | # fizzbuzz.pure 19 | # fizzbuzz.rs 20 | # fizzbuzz.setl 21 | # fizzbuzz.vg 22 | # fizzbuzz.ws 23 | # all of which require some manual installation. I plan to improve this 24 | # script so more of the prerequisites can be installed automatically. 25 | 26 | # The "g++" package is likely to be preinstalled, but I've included it 27 | # here anyway. 28 | 29 | sudo apt-get install \ 30 | algol68g bwbasic clisp clojure1.4 csh curl erlang falconpl fish fort77 \ 31 | fp-compiler g++ gdc gforth gfortran ghc gnat gnu-smalltalk golang gpt \ 32 | guile-2.0 haxe iconx libgnustep-base-dev lua5.2 mono-gmcs mono-vbnc \ 33 | octave open-cobol openjdk-7-jdk php5-cli rakudo ratfor r-base-core \ 34 | regina-rexx rhino ruby scala ucblogo valac vim \ 35 | cmake 36 | -------------------------------------------------------------------------------- /fizzbuzz.bas: -------------------------------------------------------------------------------- 1 | 1 REM Language: BASIC 2 | 2 REM Web site: https://sourceforge.net/projects/bwbasic/ 3 | 3 REM Last tested on: Ubuntu 24.04.2 LTS 4 | 4 REM Requires: apt-get install bwbasic 5 | 5 REM OR: Build from source, https://github.com/Keith-S-Thompson/bwbasic, branch "3.20+fixes" 6 | 6 REM NOTE: bwBASIC actually supports a structured IF/THEN/ELSE 7 | 7 REM statement, but I decided to use old-style line numbers 8 | 8 REM and GOTO statements for the sake of nostalgia. 9 | 9 REM NOTE: The default version of bwbasic (2.20p2) prints a copyright 10 | 10 REM header and a trailing blank line, with no way to disable it. 11 | 11 REM The copyright header was removed in a later version, and 12 | 12 REM my version removes the trailing blank line. 13 | 13 REM An earlier version of the `verify` script filters the output; 14 | 14 REM that's no longer needed. 15 | 100 FOR I = 1 TO 100 16 | 110 IF I MOD 15 = 0 THEN GOTO 200 17 | 120 IF I MOD 3 = 0 THEN GOTO 160 18 | 130 IF I MOD 5 = 0 THEN GOTO 180 19 | 140 PRINT USING "#";I 20 | 150 GOTO 210 21 | 160 PRINT "Fizz" 22 | 170 GOTO 210 23 | 180 PRINT "Buzz" 24 | 190 GOTO 210 25 | 200 PRINT "FizzBuzz" 26 | 210 NEXT I 27 | 220 QUIT 28 | -------------------------------------------------------------------------------- /fizzbuzz.sed: -------------------------------------------------------------------------------- 1 | #!/bin/sed -f 2 | 3 | # Language: Sed 4 | # Web site: https://www.gnu.org/software/sed/ 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: The "sed" package is preinstalled. 7 | 8 | # Requires input of a single empty line. 9 | 10 | s/^$/1/ 11 | a2 12 | aFizz 13 | a4 14 | aBuzz 15 | aFizz 16 | a7 17 | a8 18 | aFizz 19 | aBuzz 20 | a11 21 | aFizz 22 | a13 23 | a14 24 | aFizzBuzz 25 | a16 26 | a17 27 | aFizz 28 | a19 29 | aBuzz 30 | aFizz 31 | a22 32 | a23 33 | aFizz 34 | aBuzz 35 | a26 36 | aFizz 37 | a28 38 | a29 39 | aFizzBuzz 40 | a31 41 | a32 42 | aFizz 43 | a34 44 | aBuzz 45 | aFizz 46 | a37 47 | a38 48 | aFizz 49 | aBuzz 50 | a41 51 | aFizz 52 | a43 53 | a44 54 | aFizzBuzz 55 | a46 56 | a47 57 | aFizz 58 | a49 59 | aBuzz 60 | aFizz 61 | a52 62 | a53 63 | aFizz 64 | aBuzz 65 | a56 66 | aFizz 67 | a58 68 | a59 69 | aFizzBuzz 70 | a61 71 | a62 72 | aFizz 73 | a64 74 | aBuzz 75 | aFizz 76 | a67 77 | a68 78 | aFizz 79 | aBuzz 80 | a71 81 | aFizz 82 | a73 83 | a74 84 | aFizzBuzz 85 | a76 86 | a77 87 | aFizz 88 | a79 89 | aBuzz 90 | aFizz 91 | a82 92 | a83 93 | aFizz 94 | aBuzz 95 | a86 96 | aFizz 97 | a88 98 | a89 99 | aFizzBuzz 100 | a91 101 | a92 102 | aFizz 103 | a94 104 | aBuzz 105 | aFizz 106 | a97 107 | a98 108 | aFizz 109 | aBuzz 110 | -------------------------------------------------------------------------------- /fizzbuzz.ed: -------------------------------------------------------------------------------- 1 | # Language: ed 2 | # Web site: https://www.gnu.org/software/ed/ 3 | # https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ed.html 4 | # Last tested on: Ubuntu 24.04.2 LTS 5 | # Requires: The "ed" package is preinstalled. 6 | # 7 | r !seq 100 8 | 3s/.*/Fizz/ 9 | +3s/.*/Fizz/ 10 | +3s/.*/Fizz/ 11 | +3s/.*/Fizz/ 12 | +3s/.*/Fizz/ 13 | +3s/.*/Fizz/ 14 | +3s/.*/Fizz/ 15 | +3s/.*/Fizz/ 16 | +3s/.*/Fizz/ 17 | +3s/.*/Fizz/ 18 | +3s/.*/Fizz/ 19 | +3s/.*/Fizz/ 20 | +3s/.*/Fizz/ 21 | +3s/.*/Fizz/ 22 | +3s/.*/Fizz/ 23 | +3s/.*/Fizz/ 24 | +3s/.*/Fizz/ 25 | +3s/.*/Fizz/ 26 | +3s/.*/Fizz/ 27 | +3s/.*/Fizz/ 28 | +3s/.*/Fizz/ 29 | +3s/.*/Fizz/ 30 | +3s/.*/Fizz/ 31 | +3s/.*/Fizz/ 32 | +3s/.*/Fizz/ 33 | +3s/.*/Fizz/ 34 | +3s/.*/Fizz/ 35 | +3s/.*/Fizz/ 36 | +3s/.*/Fizz/ 37 | +3s/.*/Fizz/ 38 | +3s/.*/Fizz/ 39 | +3s/.*/Fizz/ 40 | +3s/.*/Fizz/ 41 | 5s/.*/Buzz/ 42 | +5s/.*/Buzz/ 43 | +5s/.*/Buzz/ 44 | +5s/.*/Buzz/ 45 | +5s/.*/Buzz/ 46 | +5s/.*/Buzz/ 47 | +5s/.*/Buzz/ 48 | +5s/.*/Buzz/ 49 | +5s/.*/Buzz/ 50 | +5s/.*/Buzz/ 51 | +5s/.*/Buzz/ 52 | +5s/.*/Buzz/ 53 | +5s/.*/Buzz/ 54 | +5s/.*/Buzz/ 55 | +5s/.*/Buzz/ 56 | +5s/.*/Buzz/ 57 | +5s/.*/Buzz/ 58 | +5s/.*/Buzz/ 59 | +5s/.*/Buzz/ 60 | +5s/.*/Buzz/ 61 | 15s/.*/FizzBuzz/ 62 | +15s/.*/FizzBuzz/ 63 | +15s/.*/FizzBuzz/ 64 | +15s/.*/FizzBuzz/ 65 | +15s/.*/FizzBuzz/ 66 | +15s/.*/FizzBuzz/ 67 | 1,$p 68 | Q 69 | -------------------------------------------------------------------------------- /sh6-bug/sh6-bug.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | verbosely() { 4 | echo "% $@" 5 | "$@" 6 | } 7 | 8 | keep=false 9 | strace=false 10 | 11 | for arg in "$@" ; do 12 | if [[ $arg = "-keep" ]] ; then 13 | keep=true 14 | elif [[ $arg = "-strace" ]] ; then 15 | strace=true 16 | else 17 | echo "Usage: $0 [-keep] [-strace]" 1>&2 18 | exit 1 19 | fi 20 | done 21 | 22 | tmpdir=/tmp/sh6-bug-$$ 23 | mkdir $tmpdir && cd $tmpdir 24 | 25 | verbosely mkdir src 26 | verbosely cd src 27 | verbosely git clone https://github.com/JNeitzel/v6shell.git 28 | verbosely cd v6shell 29 | verbosely git log -n 1 30 | verbosely export PREFIX=$tmpdir/install 31 | verbosely make 32 | verbosely make install 33 | 34 | verbosely mkdir $tmpdir/test 35 | verbosely cd $tmpdir/test 36 | 37 | if $strace ; then 38 | goto_LABEL="strace -o goto.strace $PREFIX/libexec/osh-current/sh6/goto LABEL" 39 | else 40 | goto_LABEL="goto LABEL" 41 | fi 42 | 43 | cat > test.sh6 < _count 16 | 17 | : LOOP 18 | ( cat _count ; echo 1 + p ) | dc > _count.new ; mv _count.new _count 19 | 20 | ( cat _count ; echo 15 % p ) | dc > _imod15 21 | if { grep -v '^0$' _imod15 > /dev/null } goto L1 22 | echo FizzBuzz 23 | goto NEXT 24 | : L1 25 | 26 | ( cat _count ; echo 3 % p ) | dc > _imod3 27 | if { grep -v '^0$' _imod3 > /dev/null } goto L2 28 | echo Fizz 29 | goto NEXT 30 | : L2 31 | 32 | ( cat _count ; echo 5 % p ) | dc > _imod5 33 | if { grep -v '^0$' _imod5 > /dev/null } goto L3 34 | echo Buzz 35 | goto NEXT 36 | : L3 37 | 38 | cat _count 39 | 40 | : NEXT 41 | if { grep '^100$' _count > /dev/null } goto DONE 42 | goto LOOP 43 | 44 | : DONE 45 | rm _count _imod3 _imod5 _imod15 46 | -------------------------------------------------------------------------------- /fizzbuzz.mod: -------------------------------------------------------------------------------- 1 | (* 2 | * Language: Modula-2 3 | * Web site: https://www.modula2.org/ 4 | * https://www.nongnu.org/gm2/ 5 | * Last tested on: Ubuntu 24.04.2 LTS 6 | * 7 | * gm2, the GNU Modula-2 compiler, can normally be installed as a package. 8 | * See https://www.nongnu.org/gm2/debian.html 9 | * But that resulted in errors from the gm2 command, which I've been unable to resolve: 10 | * /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/m2/m2pim/libm2pim.so: undefined reference to `RTco_select' 11 | * /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/m2/m2pim/libm2pim.so: undefined reference to `RTco_initSemaphore' 12 | * /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/m2/m2pim/libm2pim.so: undefined reference to `RTco_wait' 13 | * /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/m2/m2pim/libm2pim.so: undefined reference to `RTco_signal' 14 | * collect2: error: ld returned 1 exit status 15 | * 16 | * Instead, I've installed the compiler by building it from source from the git repo: 17 | * git://gcc.gnu.org/git/gcc.git 18 | * branch devel/modula-2 (commit c92177a3eb2, 2022-10-10) 19 | * Configure with "--enable-languages=m2 -enable-host-shared" 20 | *) 21 | 22 | MODULE fizzbuzz; 23 | FROM StrIO IMPORT WriteString, WriteLn; 24 | FROM NumberIO IMPORT WriteCard; 25 | VAR 26 | I: CARDINAL; 27 | BEGIN 28 | FOR I := 1 TO 100 DO 29 | IF I MOD 15 = 0 THEN 30 | WriteString("FizzBuzz"); 31 | ELSIF I MOD 3 = 0 THEN 32 | WriteString("Fizz"); 33 | ELSIF I MOD 5 = 0 THEN 34 | WriteString("Buzz"); 35 | ELSE 36 | WriteCard(I, 0); 37 | END; 38 | WriteLn; 39 | END 40 | END fizzbuzz. 41 | -------------------------------------------------------------------------------- /fizzbuzz.a60: -------------------------------------------------------------------------------- 1 | begin 2 | comment Language: Algol 60; 3 | comment Web site: https://www.algol60.org/; 4 | comment https://www.algol60.org/translators/a60-0.22.tar.gz; 5 | comment Last tested on: Ubuntu 24.04.2 LTS; 6 | comment Requires: Build and install a60 interpreter from source; 7 | 8 | integer procedure idivide(x, y); integer x, y; 9 | comment ÷ is integer division, but the a60 interpreter doesn't recognize it; 10 | begin 11 | integer result; 12 | result := entier(x / y); 13 | idivide := result; 14 | end; 15 | 16 | integer procedure mod(x, y); integer x, y; 17 | begin 18 | mod := x - idivide(x, y) * y; 19 | end; 20 | 21 | procedure printdigit(d); integer d; 22 | comment Ugh! ; 23 | begin 24 | if d = 0 then outstring(1, "0") 25 | else if d = 1 then outstring(1, "1") 26 | else if d = 2 then outstring(1, "2") 27 | else if d = 3 then outstring(1, "3") 28 | else if d = 4 then outstring(1, "4") 29 | else if d = 5 then outstring(1, "5") 30 | else if d = 6 then outstring(1, "6") 31 | else if d = 7 then outstring(1, "7") 32 | else if d = 8 then outstring(1, "8") 33 | else if d = 9 then outstring(1, "9") 34 | end; 35 | 36 | procedure printinteger(n); integer n; 37 | comment outinteger() prints leading and trailing spaces; 38 | begin 39 | if n >= 10 then printdigit(idivide(n, 10)); 40 | printdigit(mod(n, 10)); 41 | end; 42 | 43 | integer i; 44 | for i := 1 step 1 until 100 do 45 | begin 46 | if mod(i, 15) = 0 then outstring(1, "FizzBuzz\n") 47 | else if mod(i, 3) = 0 then outstring(1, "Fizz\n") 48 | else if mod(i, 5) = 0 then outstring(1, "Buzz\n") 49 | else 50 | begin 51 | printinteger(i); 52 | outstring(1, "\n"); 53 | end; 54 | end; 55 | end 56 | -------------------------------------------------------------------------------- /fizzbuzz.cob: -------------------------------------------------------------------------------- 1 | * LANGUAGE: COBOL 2 | * Web site: https://sourceforge.net/projects/gnucobol/ 3 | * Last tested on: Ubuntu 24.04.2 LTS 4 | * Requires: apt-get install gnucobol 5 | 6 | IDENTIFICATION DIVISION. 7 | PROGRAM-ID. FIZZBUZZ. 8 | 9 | DATA DIVISION. 10 | WORKING-STORAGE SECTION. 11 | 01 Variables. 12 | 05 I PIC 999 VALUE ZERO. 13 | 05 Counting PIC 99 VALUE ZERO. 14 | 05 Start-Position PIC 99 VALUE ZERO. 15 | 05 Positions PIC 99 VALUE ZERO. 16 | 05 ignored PIC S99 VALUE ZERO. 17 | 05 I-MOD-15 PIC S99 VALUE ZERO. 18 | 05 I-MOD-3 PIC S99 VALUE ZERO. 19 | 05 I-MOD-5 PIC S99 VALUE ZERO. 20 | 21 | PROCEDURE DIVISION. 22 | PERFORM VARYING I FROM 1 BY 1 UNTIL I IS GREATER THAN 100 23 | 24 | DIVIDE I BY 15 GIVING ignored REMAINDER I-MOD-15 25 | IF I-MOD-15 IS EQUAL TO ZERO 26 | DISPLAY "FizzBuzz" 27 | ELSE 28 | DIVIDE I BY 3 GIVING ignored REMAINDER I-MOD-3 29 | IF I-MOD-3 IS EQUAL TO ZERO 30 | DISPLAY "Fizz" 31 | ELSE 32 | DIVIDE I BY 5 GIVING ignored REMAINDER I-MOD-5 33 | IF I-MOD-5 IS EQUAL TO ZERO 34 | DISPLAY "Buzz" 35 | ELSE 36 | MOVE ZEROES TO Counting 37 | INSPECT I, 38 | TALLYING Counting FOR LEADING ZEROES 39 | ADD 1 TO Counting GIVING Start-Position 40 | SUBTRACT Counting FROM 3 GIVING Positions 41 | DISPLAY I(Start-Position:Positions) 42 | END-IF 43 | END-IF 44 | END-IF 45 | END-PERFORM 46 | STOP RUN. 47 | -------------------------------------------------------------------------------- /list.txt: -------------------------------------------------------------------------------- 1 | fizzbuzz.a60 2 | fizzbuzz.a68 3 | fizzbuzz.adb 4 | fizzbuzz.aribas 5 | fizzbuzz.awk 6 | fizzbuzz.b 7 | fizzbuzz.bas 8 | fizzbuzz.bash 9 | fizzbuzz.bc 10 | fizzbuzz.by 11 | fizzbuzz.c 12 | fizzbuzz.c3 13 | fizzbuzz.calc 14 | fizzbuzz.cat 15 | fizzbuzz.clisp 16 | fizzbuzz.clojure 17 | fizzbuzz.cob 18 | fizzbuzz.cpp 19 | fizzbuzz.cr 20 | fizzbuzz.cs 21 | fizzbuzz.csh 22 | fizzbuzz.curl 23 | fizzbuzz.d 24 | fizzbuzz.dart 25 | fizzbuzz.ed 26 | fizzbuzz.elisp 27 | fizzbuzz.elvish 28 | fizzbuzz.erl 29 | fizzbuzz.f 30 | fizzbuzz.f66 31 | fizzbuzz.f90 32 | fizzbuzz.fal 33 | fizzbuzz.fish 34 | fizzbuzz.fizzbuzz 35 | fizzbuzz.fs 36 | fizzbuzz.gcc 37 | fizzbuzz.gdb 38 | fizzbuzz.go 39 | fizzbuzz.gp 40 | fizzbuzz.gpt 41 | fizzbuzz.gravity 42 | fizzbuzz.groovy 43 | fizzbuzz.guile 44 | fizzbuzz.hodor 45 | fizzbuzz.hs 46 | fizzbuzz.hx 47 | fizzbuzz.icn 48 | fizzbuzz.io 49 | fizzbuzz.java 50 | fizzbuzz.jl 51 | fizzbuzz.js 52 | fizzbuzz.kt 53 | fizzbuzz.l 54 | fizzbuzz.lily 55 | fizzbuzz.logo 56 | fizzbuzz.lol 57 | fizzbuzz.lua 58 | fizzbuzz.m 59 | fizzbuzz.m4 60 | fizzbuzz.mk 61 | fizzbuzz.mod 62 | fizzbuzz.myr 63 | fizzbuzz.nickle 64 | fizzbuzz.nim 65 | fizzbuzz.nodejs 66 | fizzbuzz.nqp 67 | fizzbuzz.octave 68 | fizzbuzz.pas 69 | fizzbuzz.php 70 | fizzbuzz.picolisp 71 | fizzbuzz.pike 72 | fizzbuzz.pl 73 | fizzbuzz.pli 74 | fizzbuzz.ps 75 | fizzbuzz.ps1 76 | fizzbuzz.pure 77 | fizzbuzz.py2 78 | fizzbuzz.py3 79 | fizzbuzz.r 80 | fizzbuzz.raku 81 | fizzbuzz.ratfor 82 | fizzbuzz.rb 83 | fizzbuzz.rc 84 | fizzbuzz.rexx 85 | fizzbuzz.rs 86 | fizzbuzz.scala 87 | fizzbuzz.sd7 88 | fizzbuzz.sed 89 | fizzbuzz.setl 90 | fizzbuzz.sh 91 | fizzbuzz.sh6 92 | fizzbuzz.sim 93 | fizzbuzz.sl 94 | fizzbuzz.sqlite3 95 | fizzbuzz.squirrel 96 | fizzbuzz.st 97 | fizzbuzz.swift 98 | fizzbuzz.sx 99 | fizzbuzz.tab 100 | fizzbuzz.tail 101 | fizzbuzz.tcl 102 | fizzbuzz.ts 103 | fizzbuzz.v 104 | fizzbuzz.vala 105 | fizzbuzz.vb 106 | fizzbuzz.vg 107 | fizzbuzz.vim 108 | fizzbuzz.wren 109 | fizzbuzz.ws 110 | fizzbuzz.xpl 111 | fizzbuzz.zig 112 | fizzbuzz.zsh 113 | -------------------------------------------------------------------------------- /sh6-bug/README.md: -------------------------------------------------------------------------------- 1 | The `fizzbuzz.sh6` program fails under Ubuntu 16.10. 2 | 3 | I installed osh version 4.2.1 from [this tarball](http://v6shell.org/src/osh-4.2.1.tar.gz). 4 | The problem appears to be a bug in the external `goto` command. 5 | 6 | The failure occurs on Ubuntu 16.04 and 16.10. 7 | It does not occur on Ubuntu 14.04 or CentOS 5.11. 8 | (All systems are x86_64.) 9 | 10 | `sh6_bug.bash` is a bash script that clones, builds, and installs the 11 | `v6shell` package, and runs a test script. 12 | 13 | The expected output 14 | of the test script is: 15 | 16 | one 17 | three 18 | 19 | The output on Ubuntu 16.10 is: 20 | 21 | one 22 | wo: not found 23 | 24 | implying that the `goto` command did a seek to the wrong location. 25 | 26 | `sh6-bug.bash.out` is the output of `sh-bug.bash` on Ubuntu 16.10: 27 | 28 | ./sh6-bug.bash > sh6-bug.bash.out 2>&1 29 | 30 | `sh6-bug.bash-strace.out` is the output of `sh-bug.bash -strace`: 31 | 32 | ./sh6-bug.bash -strace > sh6-bug.bash-strace.out 2>&1 33 | 34 | More information about the system I ran this on: 35 | 36 | $ cat /etc/lsb-release 37 | DISTRIB_ID=Ubuntu 38 | DISTRIB_RELEASE=16.10 39 | DISTRIB_CODENAME=yakkety 40 | DISTRIB_DESCRIPTION="Ubuntu 16.10" 41 | $ uname -a 42 | Linux bomb20 4.8.0-27-generic #29-Ubuntu SMP Thu Oct 20 21:03:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux 43 | $ gcc --version 44 | gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005 45 | Copyright (C) 2016 Free Software Foundation, Inc. 46 | This is free software; see the source for copying conditions. There is NO 47 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 48 | 49 | $ 50 | 51 | `make-check.out` is the output of `make check`, run in the `v6shell` top-level directory. 52 | 53 | `config.h` is generated by `make check`. 54 | 55 | Both are from the `current` branch: 56 | 57 | commit 38e29b34dd5d481dfba4d8cc94632bf9a5c642f9 58 | Author: Jeff Neitzel 59 | Date: 2016-12-17 18:15:34 +0000 60 | 61 | Fix external goto for sh6 on Ubuntu 16.xx 62 | 63 | This comes with a performance penalty by using read(2) instead 64 | of getchar(3), but the penalty is not very noticeable in the 65 | real world. 66 | 67 | NOTE: This does not fix the true cause of whatever the problem 68 | is with lseek(2) on Ubuntu 16.xx. 69 | 70 | The test passes when I run it with `osh` rather than `sh6`. 71 | -------------------------------------------------------------------------------- /fizzbuzz.gcc: -------------------------------------------------------------------------------- 1 | /* 2 | * Language: gcc error messages 3 | * Web site: https://www.open-std.org/JTC1/SC22/WG14/ 4 | * https://gcc.gnu.org/ 5 | * Last tested on: Ubuntu 24.04.2 LTS 6 | * Requires: The "gcc" package is pre-installed 7 | * NOTE: The stderr output of the compiler must be filtered to 8 | * extract the correct output; see the `verify` script. 9 | */ 10 | #line __LINE__ "1" 11 | #error 12 | #line __LINE__ "2" 13 | #error 14 | #line __LINE__ "Fizz" 15 | #error 16 | #line __LINE__ "4" 17 | #error 18 | #line __LINE__ "Buzz" 19 | #error 20 | #line __LINE__ "Fizz" 21 | #error 22 | #line __LINE__ "7" 23 | #error 24 | #line __LINE__ "8" 25 | #error 26 | #line __LINE__ "Fizz" 27 | #error 28 | #line __LINE__ "Buzz" 29 | #error 30 | #line __LINE__ "11" 31 | #error 32 | #line __LINE__ "Fizz" 33 | #error 34 | #line __LINE__ "13" 35 | #error 36 | #line __LINE__ "14" 37 | #error 38 | #line __LINE__ "FizzBuzz" 39 | #error 40 | #line __LINE__ "16" 41 | #error 42 | #line __LINE__ "17" 43 | #error 44 | #line __LINE__ "Fizz" 45 | #error 46 | #line __LINE__ "19" 47 | #error 48 | #line __LINE__ "Buzz" 49 | #error 50 | #line __LINE__ "Fizz" 51 | #error 52 | #line __LINE__ "22" 53 | #error 54 | #line __LINE__ "23" 55 | #error 56 | #line __LINE__ "Fizz" 57 | #error 58 | #line __LINE__ "Buzz" 59 | #error 60 | #line __LINE__ "26" 61 | #error 62 | #line __LINE__ "Fizz" 63 | #error 64 | #line __LINE__ "28" 65 | #error 66 | #line __LINE__ "29" 67 | #error 68 | #line __LINE__ "FizzBuzz" 69 | #error 70 | #line __LINE__ "31" 71 | #error 72 | #line __LINE__ "32" 73 | #error 74 | #line __LINE__ "Fizz" 75 | #error 76 | #line __LINE__ "34" 77 | #error 78 | #line __LINE__ "Buzz" 79 | #error 80 | #line __LINE__ "Fizz" 81 | #error 82 | #line __LINE__ "37" 83 | #error 84 | #line __LINE__ "38" 85 | #error 86 | #line __LINE__ "Fizz" 87 | #error 88 | #line __LINE__ "Buzz" 89 | #error 90 | #line __LINE__ "41" 91 | #error 92 | #line __LINE__ "Fizz" 93 | #error 94 | #line __LINE__ "43" 95 | #error 96 | #line __LINE__ "44" 97 | #error 98 | #line __LINE__ "FizzBuzz" 99 | #error 100 | #line __LINE__ "46" 101 | #error 102 | #line __LINE__ "47" 103 | #error 104 | #line __LINE__ "Fizz" 105 | #error 106 | #line __LINE__ "49" 107 | #error 108 | #line __LINE__ "Buzz" 109 | #error 110 | #line __LINE__ "Fizz" 111 | #error 112 | #line __LINE__ "52" 113 | #error 114 | #line __LINE__ "53" 115 | #error 116 | #line __LINE__ "Fizz" 117 | #error 118 | #line __LINE__ "Buzz" 119 | #error 120 | #line __LINE__ "56" 121 | #error 122 | #line __LINE__ "Fizz" 123 | #error 124 | #line __LINE__ "58" 125 | #error 126 | #line __LINE__ "59" 127 | #error 128 | #line __LINE__ "FizzBuzz" 129 | #error 130 | #line __LINE__ "61" 131 | #error 132 | #line __LINE__ "62" 133 | #error 134 | #line __LINE__ "Fizz" 135 | #error 136 | #line __LINE__ "64" 137 | #error 138 | #line __LINE__ "Buzz" 139 | #error 140 | #line __LINE__ "Fizz" 141 | #error 142 | #line __LINE__ "67" 143 | #error 144 | #line __LINE__ "68" 145 | #error 146 | #line __LINE__ "Fizz" 147 | #error 148 | #line __LINE__ "Buzz" 149 | #error 150 | #line __LINE__ "71" 151 | #error 152 | #line __LINE__ "Fizz" 153 | #error 154 | #line __LINE__ "73" 155 | #error 156 | #line __LINE__ "74" 157 | #error 158 | #line __LINE__ "FizzBuzz" 159 | #error 160 | #line __LINE__ "76" 161 | #error 162 | #line __LINE__ "77" 163 | #error 164 | #line __LINE__ "Fizz" 165 | #error 166 | #line __LINE__ "79" 167 | #error 168 | #line __LINE__ "Buzz" 169 | #error 170 | #line __LINE__ "Fizz" 171 | #error 172 | #line __LINE__ "82" 173 | #error 174 | #line __LINE__ "83" 175 | #error 176 | #line __LINE__ "Fizz" 177 | #error 178 | #line __LINE__ "Buzz" 179 | #error 180 | #line __LINE__ "86" 181 | #error 182 | #line __LINE__ "Fizz" 183 | #error 184 | #line __LINE__ "88" 185 | #error 186 | #line __LINE__ "89" 187 | #error 188 | #line __LINE__ "FizzBuzz" 189 | #error 190 | #line __LINE__ "91" 191 | #error 192 | #line __LINE__ "92" 193 | #error 194 | #line __LINE__ "Fizz" 195 | #error 196 | #line __LINE__ "94" 197 | #error 198 | #line __LINE__ "Buzz" 199 | #error 200 | #line __LINE__ "Fizz" 201 | #error 202 | #line __LINE__ "97" 203 | #error 204 | #line __LINE__ "98" 205 | #error 206 | #line __LINE__ "Fizz" 207 | #error 208 | #line __LINE__ "Buzz" 209 | #error 210 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | # TODO 2 | 3 | Obviously the major flaw of this project is that there just aren't 4 | enough languages. Here are a few that I plan to add when I get the 5 | proverbial Round Tuit: 6 | 7 | - [8th](https://8th-dev.com/) 8 | - [Anguish](http://blogs.perl.org/users/zoffix_znet/2016/05/anguish-invisible-programming-language-and-invisible-data-theft.html) 9 | - [APL](https://www.gnu.org/software/apl/) 10 | - [Ark](http://ark-lang.org/) 11 | - [ArnoldC](https://github.com/lhartikk/ArnoldC) 12 | - [Bato](https://github.com/jjuliano/bato) 13 | - [Batsh](https://github.com/BYVoid/Batsh) 14 | - [BCPL](http://www.cl.cam.ac.uk/~mr10/index.html) 15 | - [BLISS](https://madisongh.github.io/blissc/) 16 | - [Bloom](http://bloom-lang.net/) 17 | - [Bog](https://github.com/Vexu/bog) 18 | - [Boo](http://boo-lang.org/) 19 | - [Brainfuck](http://www.muppetlabs.com/~breadbox/bf/) 20 | - [C--](http://www.cs.tufts.edu/~nr/c--/) 21 | - [C2](http://c2lang.org/) 22 | - [Carbon](https://github.com/carbon-language/carbon-lang) 23 | - [Ceylon](http://ceylon-lang.org/) 24 | - [Chapel](https://chapel-lang.org/) 25 | - [Clu](https://en.wikipedia.org/wiki/CLU_(programming_language)) ... [see also clu2c](http://woodsheep.jp/clu2c.html) [current download](ftp://ftp.lip6.fr/pub/lang/clu/clu2c/) 26 | - [Cmajor](https://sourceforge.net/projects/cmajor/) 27 | - [Cobra](http://cobra-language.com/) 28 | - [Coconut](http://coconut-lang.org/) 29 | - [Cotowali](https://github.com/cotowali/cotowali) 30 | - [Cyber](https://cyberscript.dev/) 31 | - [Cyclone](http://cyclone.thelanguage.org/) 32 | - [Cyclops](http://cyclopslang.org/) 33 | - [Dale](https://github.com/tomhrr/dale) 34 | - [E](https://en.wikipedia.org/wiki/E_(programming_language)) ... [see also](http://erights.org/) 35 | - [Egison](https://www.egison.org/) 36 | - [Eiffel](https://en.wikipedia.org/wiki/Eiffel_(programming_language)) 37 | - [Elixir](http://elixir-lang.org/) 38 | - [Elm](http://elm-lang.org/) 39 | - [Euphoria](http://www.rapideuphoria.com/) 40 | - [Factor](http://factorcode.org/) 41 | - [Foo](https://esolangs.org/wiki/Foo) 42 | - [Frege](https://github.com/Frege/frege) -- Similar or identical to Haskell 43 | - [Frink](https://frinklang.org/) 44 | - [Gambas](https://en.wikipedia.org/wiki/Gambas) 45 | - [Gluon](http://gluon-lang.org/) 46 | - [Intercal](http://catb.org/esr/intercal/) 47 | - [Joy](https://en.wikipedia.org/wiki/Joy_(programming_language)) 48 | - [K](https://en.wikipedia.org/wiki/K_(programming_language)) 49 | - [Kit](https://www.kitlang.org/) 50 | - [Kitten](http://kittenlang.org/) 51 | - [KLisp (kernel)](http://klisp.org/) 52 | - [LISP/C](https://github.com/eratosthenesia/lispc) 53 | - [MCPL](https://www.cl.cam.ac.uk/~mr10/MCPL.html) 54 | - [Mojo](https://docs.modular.com/mojo/) 55 | - [MoonScript](http://moonscript.org/) 56 | - [Mumps](https://en.wikipedia.org/wiki/MUMPS) 57 | - [newLISP](http://www.newlisp.org/) 58 | - [Ni](https://github.com/gokr/ni) ... [see also](http://goran.krampe.se/2015/09/16/ni-a-strange-little-language/) 59 | - [OCaml](https://ocaml.org/) 60 | - [Odin](https://odin-lang.org/) 61 | - [Oz](http://mozart.github.io/) 62 | - [P](https://github.com/p-org/P) 63 | - [Pharo](http://pharo.org/) 64 | - [Picat](http://picat-lang.org/) 65 | - [Plankalkül](https://en.wikipedia.org/wiki/Plankalk%C3%BCl) See also the [Konrad Zuse Internet Archive](http://zuse.zib.de/) -- It's not likely that I'll find an implementation 66 | - [PL/M](https://en.wikipedia.org/wiki/PL/M) 67 | - [Pony](https://www.ponylang.org/) 68 | - [Prolog](https://en.wikipedia.org/wiki/Prolog) 69 | - [Pyth](https://pyth.readthedocs.io/) 70 | - [Q](https://code.kx.com/q/) 71 | - [Racket](https://racket-lang.org/) 72 | - [Rebol](http://www.rebol.com/) 73 | - [Red](http://www.red-lang.org/) 74 | - [Rockstar](https://codewithrockstar.com/) 75 | - [RPL/2](http://www.rpl2.net/) 76 | - [Self](http://www.selflanguage.org/) 77 | - [SNOBOL/SPITBOL](http://daveshields.me/2012/09/02/on-being-the-maintainer-sole-developer-and-probably-the-sole-active-user-of-the-programming-language-spitbol/) 78 | - [Stanza](http://lbstanza.org/) 79 | - [TECO](http://almy.us/teco.html) ... [see also](http://goodmath.scientopia.org/2010/11/30/the-glorious-horror-of-teco/) 80 | - [Terra](http://terralang.org/index.html) 81 | - [TrumpScript](https://github.com/samshadwell/TrumpScript) 82 | - [Useless](https://esolangs.org/wiki/Useless) (This will require implementing platform-specific features) 83 | - [Whenever](http://www.dangermouse.net/esoteric/whenever.html) 84 | - [Whiley](http://whiley.org/) 85 | - [Wren](https://munificent.github.io/wren/index.html) 86 | - [Xonsh](http://xon.sh/) 87 | - [Yorick](http://yorick.sourceforge.net) 88 | - [Zimbu](http://www.zimbu.org/) 89 | -------------------------------------------------------------------------------- /fizzbuzz.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | # Language: Make 4 | # Web site: http://www.gnu.org/software/make/ (for the GNU implementation) 5 | # Last tested on: Ubuntu 24.04.2 LTS 6 | # Requires: The "make" package is pre-installed 7 | 8 | # This is a brute-force approach, where each line depends on the previous 9 | # one. There may be a way to force make itself to do the iteration and/or 10 | # computation, but I haven't taken the time to find it. 11 | 12 | fizzbuzz_all: fizzbuzz100 13 | fizzbuzz92: fizzbuzz91 14 | @echo 92 15 | fizzbuzz67: fizzbuzz66 16 | @echo 67 17 | fizzbuzz80: fizzbuzz79 18 | @echo Buzz 19 | fizzbuzz82: fizzbuzz81 20 | @echo 82 21 | fizzbuzz51: fizzbuzz50 22 | @echo Fizz 23 | fizzbuzz54: fizzbuzz53 24 | @echo Fizz 25 | fizzbuzz84: fizzbuzz83 26 | @echo Fizz 27 | fizzbuzz17: fizzbuzz16 28 | @echo 17 29 | fizzbuzz62: fizzbuzz61 30 | @echo 62 31 | fizzbuzz64: fizzbuzz63 32 | @echo 64 33 | fizzbuzz47: fizzbuzz46 34 | @echo 47 35 | fizzbuzz22: fizzbuzz21 36 | @echo 22 37 | fizzbuzz81: fizzbuzz80 38 | @echo Fizz 39 | fizzbuzz39: fizzbuzz38 40 | @echo Fizz 41 | fizzbuzz90: fizzbuzz89 42 | @echo FizzBuzz 43 | fizzbuzz79: fizzbuzz78 44 | @echo 79 45 | fizzbuzz41: fizzbuzz40 46 | @echo 41 47 | fizzbuzz61: fizzbuzz60 48 | @echo 61 49 | fizzbuzz94: fizzbuzz93 50 | @echo 94 51 | fizzbuzz19: fizzbuzz18 52 | @echo 19 53 | fizzbuzz56: fizzbuzz55 54 | @echo 56 55 | fizzbuzz78: fizzbuzz77 56 | @echo Fizz 57 | fizzbuzz10: fizzbuzz9 58 | @echo Buzz 59 | fizzbuzz77: fizzbuzz76 60 | @echo 77 61 | fizzbuzz25: fizzbuzz24 62 | @echo Buzz 63 | fizzbuzz59: fizzbuzz58 64 | @echo 59 65 | fizzbuzz8: fizzbuzz7 66 | @echo 8 67 | fizzbuzz96: fizzbuzz95 68 | @echo Fizz 69 | fizzbuzz89: fizzbuzz88 70 | @echo 89 71 | fizzbuzz29: fizzbuzz28 72 | @echo 29 73 | fizzbuzz98: fizzbuzz97 74 | @echo 98 75 | fizzbuzz55: fizzbuzz54 76 | @echo Buzz 77 | fizzbuzz5: fizzbuzz4 78 | @echo Buzz 79 | fizzbuzz23: fizzbuzz22 80 | @echo 23 81 | fizzbuzz70: fizzbuzz69 82 | @echo Buzz 83 | fizzbuzz34: fizzbuzz33 84 | @echo 34 85 | fizzbuzz46: fizzbuzz45 86 | @echo 46 87 | fizzbuzz76: fizzbuzz75 88 | @echo 76 89 | fizzbuzz24: fizzbuzz23 90 | @echo Fizz 91 | fizzbuzz14: fizzbuzz13 92 | @echo 14 93 | fizzbuzz57: fizzbuzz56 94 | @echo Fizz 95 | fizzbuzz30: fizzbuzz29 96 | @echo FizzBuzz 97 | fizzbuzz50: fizzbuzz49 98 | @echo Buzz 99 | fizzbuzz3: fizzbuzz2 100 | @echo Fizz 101 | fizzbuzz72: fizzbuzz71 102 | @echo Fizz 103 | fizzbuzz37: fizzbuzz36 104 | @echo 37 105 | fizzbuzz97: fizzbuzz96 106 | @echo 97 107 | fizzbuzz32: fizzbuzz31 108 | @echo 32 109 | fizzbuzz63: fizzbuzz62 110 | @echo Fizz 111 | fizzbuzz100: fizzbuzz99 112 | @echo Buzz 113 | fizzbuzz7: fizzbuzz6 114 | @echo 7 115 | fizzbuzz31: fizzbuzz30 116 | @echo 31 117 | fizzbuzz75: fizzbuzz74 118 | @echo FizzBuzz 119 | fizzbuzz38: fizzbuzz37 120 | @echo 38 121 | fizzbuzz53: fizzbuzz52 122 | @echo 53 123 | fizzbuzz42: fizzbuzz41 124 | @echo Fizz 125 | fizzbuzz12: fizzbuzz11 126 | @echo Fizz 127 | fizzbuzz6: fizzbuzz5 128 | @echo Fizz 129 | fizzbuzz60: fizzbuzz59 130 | @echo FizzBuzz 131 | fizzbuzz35: fizzbuzz34 132 | @echo Buzz 133 | fizzbuzz87: fizzbuzz86 134 | @echo Fizz 135 | fizzbuzz49: fizzbuzz48 136 | @echo 49 137 | fizzbuzz4: fizzbuzz3 138 | @echo 4 139 | fizzbuzz74: fizzbuzz73 140 | @echo 74 141 | fizzbuzz73: fizzbuzz72 142 | @echo 73 143 | fizzbuzz33: fizzbuzz32 144 | @echo Fizz 145 | fizzbuzz40: fizzbuzz39 146 | @echo Buzz 147 | fizzbuzz26: fizzbuzz25 148 | @echo 26 149 | fizzbuzz88: fizzbuzz87 150 | @echo 88 151 | fizzbuzz15: fizzbuzz14 152 | @echo FizzBuzz 153 | fizzbuzz48: fizzbuzz47 154 | @echo Fizz 155 | fizzbuzz68: fizzbuzz67 156 | @echo 68 157 | fizzbuzz69: fizzbuzz68 158 | @echo Fizz 159 | fizzbuzz28: fizzbuzz27 160 | @echo 28 161 | fizzbuzz36: fizzbuzz35 162 | @echo Fizz 163 | fizzbuzz18: fizzbuzz17 164 | @echo Fizz 165 | fizzbuzz44: fizzbuzz43 166 | @echo 44 167 | fizzbuzz52: fizzbuzz51 168 | @echo 52 169 | fizzbuzz13: fizzbuzz12 170 | @echo 13 171 | fizzbuzz27: fizzbuzz26 172 | @echo Fizz 173 | fizzbuzz65: fizzbuzz64 174 | @echo Buzz 175 | fizzbuzz1: 176 | @echo 1 177 | fizzbuzz11: fizzbuzz10 178 | @echo 11 179 | fizzbuzz45: fizzbuzz44 180 | @echo FizzBuzz 181 | fizzbuzz16: fizzbuzz15 182 | @echo 16 183 | fizzbuzz9: fizzbuzz8 184 | @echo Fizz 185 | fizzbuzz71: fizzbuzz70 186 | @echo 71 187 | fizzbuzz66: fizzbuzz65 188 | @echo Fizz 189 | fizzbuzz86: fizzbuzz85 190 | @echo 86 191 | fizzbuzz95: fizzbuzz94 192 | @echo Buzz 193 | fizzbuzz58: fizzbuzz57 194 | @echo 58 195 | fizzbuzz93: fizzbuzz92 196 | @echo Fizz 197 | fizzbuzz99: fizzbuzz98 198 | @echo Fizz 199 | fizzbuzz83: fizzbuzz82 200 | @echo 83 201 | fizzbuzz43: fizzbuzz42 202 | @echo 43 203 | fizzbuzz2: fizzbuzz1 204 | @echo 2 205 | fizzbuzz85: fizzbuzz84 206 | @echo Buzz 207 | fizzbuzz20: fizzbuzz19 208 | @echo Buzz 209 | fizzbuzz21: fizzbuzz20 210 | @echo Fizz 211 | fizzbuzz91: fizzbuzz90 212 | @echo 91 213 | -------------------------------------------------------------------------------- /sh6-bug/make-check.out: -------------------------------------------------------------------------------- 1 | /bin/sh ./mkconfig 2 | mkconfig: PATH_LOGIN == "/bin/login" 3 | Modify value in "config.h" if this is incorrect. 4 | mkconfig: PATH_NEWGRP == "/usr/bin/newgrp" 5 | Modify value in "config.h" if this is incorrect. 6 | make[1]: Entering directory '/home/kst/git/v6shell' 7 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/usr/local/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/usr/local/libexec/osh-current/sh6"' -DSYSCONFDIR='"/usr/local/etc"' v.c 8 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/usr/local/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/usr/local/libexec/osh-current/sh6"' -DSYSCONFDIR='"/usr/local/etc"' osh.c 9 | osh.c: In function ‘source_open’: 10 | osh.c:2560:4: warning: ignoring return value of ‘writev’, declared with attribute warn_unused_result [-Wunused-result] 11 | (void)writev(FD2, msg, 6); 12 | ^~~~~~~~~~~~~~~~~~~~~~~~~ 13 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/usr/local/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/usr/local/libexec/osh-current/sh6"' -DSYSCONFDIR='"/usr/local/etc"' err.c 14 | err.c: In function ‘wmsg’: 15 | err.c:254:5: warning: ignoring return value of ‘writev’, declared with attribute warn_unused_result [-Wunused-result] 16 | (void)writev(FD2, ev, 4); 17 | ^~~~~~~~~~~~~~~~~~~~~~~~ 18 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/usr/local/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/usr/local/libexec/osh-current/sh6"' -DSYSCONFDIR='"/usr/local/etc"' lib.c 19 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/usr/local/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/usr/local/libexec/osh-current/sh6"' -DSYSCONFDIR='"/usr/local/etc"' util.c 20 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/usr/local/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/usr/local/libexec/osh-current/sh6"' -DSYSCONFDIR='"/usr/local/etc"' pexec.c 21 | pexec.c: In function ‘pexec’: 22 | pexec.c:143:4: warning: ignoring return value of ‘writev’, declared with attribute warn_unused_result [-Wunused-result] 23 | (void)writev(FD2, msg, 3); 24 | ^~~~~~~~~~~~~~~~~~~~~~~~~ 25 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/usr/local/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/usr/local/libexec/osh-current/sh6"' -DSYSCONFDIR='"/usr/local/etc"' sasignal.c 26 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/usr/local/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/usr/local/libexec/osh-current/sh6"' -DSYSCONFDIR='"/usr/local/etc"' strtoint.c 27 | cc -o osh v.o osh.o err.o lib.o util.o pexec.o sasignal.o strtoint.o 28 | make[1]: Leaving directory '/home/kst/git/v6shell' 29 | Saturday, 2016-12-17, 11:28:37 PST 30 | Testing osh binary . . . . . . . . Done . 31 | Testing sh6 binary . . . . --- test05_sh6.log 2016-12-15 17:21:07.345985981 -0800 32 | +++ - 2016-12-17 11:28:47.888197869 -0800 33 | @@ -1,232 +1,4 @@ 34 | Begin ... 35 | % " 36 | syntax error 37 | -% : nothing; " 38 | -syntax error 39 | -% "; : nothing 40 | -syntax error 41 | -% ( " ) 42 | -syntax error 43 | -% : nothing; ( " ) 44 | -syntax error 45 | -% ( " ); : nothing 46 | -syntax error 47 | -% ( : nothing; " ) 48 | -syntax error 49 | -% ( "; : nothing ) 50 | -syntax error 51 | -% ' 52 | -syntax error 53 | -% : nothing; ' 54 | -syntax error 55 | -% '; : nothing 56 | -syntax error 57 | -% ( ' ) 58 | -syntax error 59 | -% : nothing; ( ' ) 60 | -syntax error 61 | -% ( ' ); : nothing 62 | -syntax error 63 | -% ( : nothing; ' ) 64 | -syntax error 65 | -% ( '; : nothing ) 66 | -syntax error 67 | -% | 68 | -syntax error 69 | -% ^ 70 | -syntax error 71 | -% | | 72 | -syntax error 73 | -% ^ ^ 74 | -syntax error 75 | -% | cat 76 | -syntax error 77 | -% ^ cat 78 | -syntax error 79 | -% echo Hello! | 80 | -syntax error 81 | -% echo Hello! ^ 82 | -syntax error 83 | -% echo Hello! | cat | 84 | -syntax error 85 | -% echo Hello! ^ cat ^ 86 | -syntax error 87 | -% echo Hello! | | grep H 88 | -syntax error 89 | -% echo Hello! ^ ^ grep H 90 | -syntax error 91 | -% || 92 | -syntax error 93 | -% ^^ 94 | -syntax error 95 | -% |cat 96 | -syntax error 97 | -% ^cat 98 | -syntax error 99 | -% echo Hello!| 100 | -syntax error 101 | -% echo Hello!^ 102 | -syntax error 103 | -% echo Hello!|cat| 104 | -syntax error 105 | -% echo Hello!^cat^ 106 | -syntax error 107 | -% echo Hello!||grep H 108 | -syntax error 109 | -% echo Hello!^^grep H 110 | -syntax error 111 | -% ( 112 | -syntax error 113 | -% ( echo Hello! 114 | -syntax error 115 | -% ( ( echo Hello! ) 116 | -syntax error 117 | -% ( ( echo Hello! ); echo Hello again! 118 | -syntax error 119 | -% echo Hello! | ( ( cat ) | grep H 120 | -syntax error 121 | -% ( echo Hello! | ( ( cat ) | grep H ) 122 | -syntax error 123 | -% echo Hello! ^ ( ( cat ) ^ grep H 124 | -syntax error 125 | -% ( echo Hello! ^ ( ( cat ) ^ grep H ) 126 | -syntax error 127 | -% ) 128 | -syntax error 129 | -% echo Hello! ) 130 | -syntax error 131 | -% ( echo Hello! ) ) 132 | -syntax error 133 | -% ( echo Hello! ); echo Hello again! ) 134 | -syntax error 135 | -% echo Hello! | ( cat ) ) | grep H 136 | -syntax error 137 | -% ( echo Hello! | ( cat ) ) | grep H ) 138 | -syntax error 139 | -% echo Hello! ^ ( cat ) ) ^ grep H 140 | -syntax error 141 | -% ( echo Hello! ^ ( cat ) ) ^ grep H ) 142 | -syntax error 143 | -% ( ) 144 | -syntax error 145 | -% ( ( ) ) 146 | -syntax error 147 | -% ( ( ( ) ) ) 148 | -syntax error 149 | -% ( echo Hello! ) | ( ) | ( grep H ) 150 | -syntax error 151 | -% ( ( echo Hello! ) | ( ) | ( grep H ) ) 152 | -syntax error 153 | -% () 154 | -syntax error 155 | -% (()) 156 | -syntax error 157 | -% ((())) 158 | -syntax error 159 | -% (echo Hello!)|()|(grep H) 160 | -syntax error 161 | -% ((echo Hello!)|()|(grep H)) 162 | -syntax error 163 | -% :( echo Hello! ) 164 | -syntax error 165 | -% echo ( Hello! ) 166 | -syntax error 167 | -% : nothing /dev/null : nothing 176 | -syntax error 177 | -% ( echo Hello! ) : nothing >/dev/null 178 | -syntax error 179 | -% < 180 | -syntax error 181 | -% > 182 | -syntax error 183 | -% >> 184 | -syntax error 185 | -% <> 186 | -syntax error 187 | -% >< 188 | -syntax error 189 | -% <>> 190 | -syntax error 191 | -% >>< 192 | -syntax error 193 | -% cat < >/dev/null 194 | -syntax error 195 | -% cat > 198 | -syntax error 199 | -% cat >/dev/null < 200 | -syntax error 201 | -% /dev/null 208 | -syntax error 209 | -% >/dev/null 210 | -syntax error 211 | -% >/dev/null >/dev/null 214 | -syntax error 215 | -% >>/dev/null /dev/null ( | ) 220 | -syntax error 221 | -% ( | ) /dev/null 224 | -syntax error 225 | -% /dev/null ( | ) 226 | -syntax error 227 | -% >/dev/null /dev/null 230 | -syntax error 231 | -% >/dev/null ( | ) /dev/null 234 | -syntax error 235 | -% ( | ) >/dev/null /dev/null ( < ) 240 | -syntax error 241 | -% ( < ) /dev/null 244 | -syntax error 245 | -% /dev/null ( < ) 246 | -syntax error 247 | -% >/dev/null /dev/null 250 | -syntax error 251 | -% >/dev/null ( < ) /dev/null 254 | -syntax error 255 | -% ( < ) >/dev/null $out 21 | ;; 22 | 23 | adb) 24 | gnatmake $basename 25 | ./$basename > $out 26 | ;; 27 | b) 28 | sed 's/^$/#include /;s/main()/int main(void)/;s/auto/auto int/;s/*n/\\n/' $filename >| $filename.c 29 | gcc $filename.c -o $basename 30 | ./$basename > $out 31 | ;; 32 | bas) 33 | bwbasic $filename > $out 34 | ;; 35 | c) 36 | gcc -std=c99 $filename -o $basename 37 | ./$basename > $out 38 | ;; 39 | c3) 40 | c3c compile $filename 41 | ./$basename > $out 42 | ;; 43 | cob) 44 | cobc -x $filename 45 | ./$basename > $out 46 | ;; 47 | cpp) 48 | g++ $filename -o $basename 49 | ./$basename > $out 50 | ;; 51 | cr) 52 | crystal build $filename 53 | ./$basename > $out 54 | ;; 55 | cs) 56 | mcs $filename 57 | mono $basename.exe > $out 58 | ;; 59 | curl) 60 | ./$filename > $out 2>/dev/null 61 | ;; 62 | d) 63 | gdc $filename -o $basename 64 | ./$basename > $out 65 | ;; 66 | ed) 67 | ed -s < $filename > $out 68 | ;; 69 | elisp) 70 | ./$filename 2>/dev/null > $out 71 | ;; 72 | f66) 73 | cp $filename fizzbuzz66.f 74 | gfortran -std=legacy fizzbuzz66.f -o $basename 75 | ./$basename > $out 76 | ;; 77 | f) 78 | # Fortran 77 79 | gfortran -std=legacy $filename -o $basename 80 | ./$basename > $out 81 | ;; 82 | f90) 83 | gfortran $filename -o $basename 84 | ./$basename > $out 85 | ;; 86 | gcc) 87 | gcc -x c -c $filename 2>&1 | sed 's/:.*//' > $out 88 | ;; 89 | gdb) 90 | gdb -q -x $filename > $out 91 | ;; 92 | go) 93 | go build -o $basename $filename 94 | ./$basename > $out 95 | ;; 96 | gp) 97 | gp -q $filename > $out 98 | ;; 99 | gpt) 100 | gpt $filename -o $basename 101 | ./$basename > $out 102 | ;; 103 | gravity) 104 | gravity -q $filename > $out 105 | ;; 106 | groovy) 107 | groovyc $filename 108 | jar cvf $basename.jar *.class 109 | CLASSPATH=$basename.jar groovy $basename > $out 110 | ;; 111 | hs) 112 | ghc $filename 113 | ./$basename > $out 114 | ;; 115 | hx) 116 | # Haxe requires a class name to start with an uppercase letter, 117 | # and requires the source file name to match the class name. 118 | cp -p $filename Fizzbuzz.hx 119 | haxe -main Fizzbuzz --interp > $out 120 | ;; 121 | icn) 122 | icont $filename 123 | ./$basename > $out 124 | ;; 125 | java) 126 | javac $filename 127 | java $basename > $out 128 | ;; 129 | kt) 130 | kotlinc $filename -include-runtime -d $basename.jar 131 | java -jar $basename.jar > $out 132 | ;; 133 | logo) 134 | # ucblogo 6.0 depends on X11 135 | timeout 10 ./$filename > $out 136 | ;; 137 | pas) 138 | fpc $filename 139 | ./$basename > $out 140 | ;; 141 | pli) 142 | # compile and link commands derived from samples/Makefile.Linux in pli tarball 143 | PLI=/o/apps/pli-0.9.10c 144 | $PLI/bin/plic -C -dELF -lsiaxgo -ew "-cn(^) -i$PLI/lib/include" fizzbuzz.pli -o fizzbuzz.o 145 | ld -z muldefs -Bstatic -o fizzbuzz --oformat=elf32-i386 -melf_i386 -e main fizzbuzz.o --start-group $PLI/lib/libprf.a --end-group 146 | ./$basename > $out 147 | ;; 148 | ps) 149 | gs -q -dNODISPLAY $filename > $out 150 | ;; 151 | pure) 152 | ./$filename > $out 153 | ;; 154 | m) 155 | # . /usr/share/GNUstep/Makefiles/GNUstep.sh 156 | # The above doesn't seem to be necessary 157 | gcc -std=c99 $(gnustep-config --objc-flags) $filename -lobjc -lgnustep-base -o $basename 158 | ./$basename > $out 159 | ;; 160 | m4) 161 | m4 $filename > $out 162 | ;; 163 | mod) 164 | gm2 -fiso $filename -o $basename 165 | ./$basename > $out 166 | ;; 167 | myr) 168 | mbld -b $basename $filename 169 | ./$basename > $out 170 | ;; 171 | nim) 172 | nim compile $filename 173 | ./$basename > $out 174 | ;; 175 | nodejs) 176 | ./$filename & 177 | sleep 1 178 | curl --silent http://localhost:9000 > $out 179 | ;; 180 | ratfor) 181 | ratfor -o $filename.f $filename 182 | f77 $filename.f -o $basename 183 | ./$basename > $out 184 | ;; 185 | rs) 186 | rustc $filename 187 | ./$basename > $out 188 | ;; 189 | scala) 190 | scalac $filename 191 | jar cfe $basename.jar $basename *.class 192 | scala $basename.jar > $out 193 | ;; 194 | sd7) 195 | s7c $filename 196 | ./$basename > $out 197 | ;; 198 | sed) 199 | echo '' | ./$filename > $out 200 | ;; 201 | sim) 202 | cim -e $filename 203 | ./$basename > $out 204 | ;; 205 | sqlite3) 206 | sqlite3 -init $filename < /dev/null > $out 207 | ;; 208 | sx) 209 | gcc $filename -o $basename 210 | ./$basename > $out 211 | ;; 212 | tab) 213 | tab -f <(grep -v '^#' $filename) > $out 214 | ;; 215 | tail) 216 | _POSIX2_VERSION=199209 ./$filename > $out 217 | ;; 218 | ts) 219 | tsc --outfile "fizzbuzz_$$.js" "$filename" && node "fizzbuzz_$$.js" > $out 220 | rm "fizzbuzz_$$.js" 221 | ;; 222 | v) 223 | v $filename 224 | ./$basename > $out 225 | ;; 226 | vala) 227 | valac $filename -o $basename 228 | ./$basename > $out 229 | ;; 230 | vb) 231 | vbnc $filename 232 | mono $basename.exe > $out 233 | ;; 234 | vim) 235 | vim --cmd "source $filename" 236 | ;; 237 | ws) 238 | whitespace $filename > $out 239 | ;; 240 | xpl) 241 | xpldir=/o/apps/xpl-0.6 242 | $xpldir/bin/xpl $filename 243 | gcc -I$xpldir/include fizzbuzz.c -L$xpldir/lib -lxpl -o fizzbuzz 244 | ./fizzbuzz >$out 245 | ;; 246 | zig) 247 | zig run $filename >$out 248 | ;; 249 | *) 250 | ./$filename > $out 251 | ;; 252 | esac 253 | if ! cmp -s $out ../expected-output.txt ; then 254 | ok=false 255 | failures="$failures $filename" 256 | (( failure_count++ )) 257 | fi 258 | cd .. 259 | rm -rf $tmpdir 260 | (( count++ )) 261 | } 262 | 263 | if [ $# -gt 0 ] ; then 264 | for file in "$@" ; do 265 | run $file 266 | done 267 | else 268 | for file in $(cat list.txt) ; do 269 | run $file 270 | done 271 | fi 272 | 273 | s='' 274 | if [ $count -ne 1 ] ; then 275 | s=s 276 | fi 277 | echo Tested $count language$s 278 | if $ok ; then 279 | echo OK 280 | else 281 | s=s 282 | if [ $failure_count -eq 1 ] ; then s='' ; fi 283 | echo "$failure_count failure$s: $failures" 284 | fi 285 | -------------------------------------------------------------------------------- /fizzbuzz.sx: -------------------------------------------------------------------------------- 1 | /* 2 | * Language: x86/x86_64/SPARC assembly 3 | * Web site: https://gcc.gnu.org/ 4 | * Last tested on: Ubuntu 24.04.2 LTS 5 | * Requires: The "gcc" package is pre-installed 6 | * 7 | * The code was generated from fizzbuzz.c with the command: 8 | * "gcc -std=c99 -O3 -S fizzbuzz.c" 9 | * on Linux/x86, Linux/x86_64, Cygwin, and SPARC/Solaris systems, 10 | * and then merged into a single file which can then processed by the 11 | * C preprocessor. The ".sx" suffix tells gcc to treat the file 12 | * as assembly language to be preprocessed. 13 | */ 14 | 15 | #if defined(__CYGWIN32__) 16 | .file "fizzbuzz.c" 17 | .def ___main; .scl 2; .type 32; .endef 18 | .section .rdata,"dr" 19 | LC0: 20 | .ascii "FizzBuzz\0" 21 | LC1: 22 | .ascii "Fizz\0" 23 | LC2: 24 | .ascii "Buzz\0" 25 | LC3: 26 | .ascii "%d\12\0" 27 | .text 28 | .p2align 4,,15 29 | .globl _main 30 | .def _main; .scl 2; .type 32; .endef 31 | _main: 32 | pushl %ebp 33 | movl %esp, %ebp 34 | andl $-16, %esp 35 | pushl %edi 36 | movl $1431655766, %edi 37 | pushl %esi 38 | movl $-2004318071, %esi 39 | pushl %ebx 40 | movl $1, %ebx 41 | subl $20, %esp 42 | call ___main 43 | jmp L6 44 | .p2align 4,,7 45 | L2: 46 | movl %ebx, %eax 47 | imull %edi 48 | subl %ecx, %edx 49 | leal (%edx,%edx,2), %eax 50 | cmpl %eax, %ebx 51 | je L9 52 | movl %ebx, %eax 53 | movl $1717986919, %edx 54 | imull %edx 55 | sarl %edx 56 | subl %ecx, %edx 57 | leal (%edx,%edx,4), %eax 58 | cmpl %eax, %ebx 59 | jne L5 60 | movl $LC2, (%esp) 61 | call _puts 62 | L3: 63 | addl $1, %ebx 64 | cmpl $101, %ebx 65 | je L10 66 | L6: 67 | movl %ebx, %eax 68 | movl %ebx, %ecx 69 | imull %esi 70 | sarl $31, %ecx 71 | addl %ebx, %edx 72 | sarl $3, %edx 73 | subl %ecx, %edx 74 | movl %edx, %eax 75 | sall $4, %eax 76 | subl %edx, %eax 77 | cmpl %eax, %ebx 78 | jne L2 79 | addl $1, %ebx 80 | movl $LC0, (%esp) 81 | call _puts 82 | cmpl $101, %ebx 83 | jne L6 84 | L10: 85 | addl $20, %esp 86 | xorl %eax, %eax 87 | popl %ebx 88 | popl %esi 89 | popl %edi 90 | movl %ebp, %esp 91 | popl %ebp 92 | ret 93 | .p2align 4,,7 94 | L5: 95 | movl %ebx, 4(%esp) 96 | movl $LC3, (%esp) 97 | call _printf 98 | jmp L3 99 | .p2align 4,,7 100 | L9: 101 | movl $LC1, (%esp) 102 | call _puts 103 | jmp L3 104 | .def _puts; .scl 2; .type 32; .endef 105 | .def _printf; .scl 2; .type 32; .endef 106 | #elif defined(__sun__) && defined(__sparc__) 107 | .file "fizzbuzz.c" 108 | .section ".rodata" 109 | .align 8 110 | .LLC0: 111 | .asciz "FizzBuzz" 112 | .align 8 113 | .LLC1: 114 | .asciz "Fizz" 115 | .align 8 116 | .LLC2: 117 | .asciz "Buzz" 118 | .align 8 119 | .LLC3: 120 | .asciz "%d\n" 121 | .section ".text" 122 | .align 4 123 | .global main 124 | .type main, #function 125 | .proc 04 126 | main: 127 | save %sp, -112, %sp 128 | sethi %hi(-2004318208), %g1 129 | sethi %hi(1431655424), %g2 130 | or %g1, 137, %l2 131 | sethi %hi(1717986304), %g1 132 | or %g2, 342, %l1 133 | or %g1, 615, %l0 134 | sethi %hi(.LLC3), %g2 135 | sethi %hi(.LLC2), %g1 136 | or %g2, %lo(.LLC3), %l5 137 | or %g1, %lo(.LLC2), %l4 138 | sethi %hi(.LLC1), %g2 139 | sethi %hi(.LLC0), %g1 140 | or %g2, %lo(.LLC1), %l6 141 | or %g1, %lo(.LLC0), %l3 142 | ba,pt %xcc, .LL2 143 | mov 1, %i0 144 | .LL3: 145 | add %g4, %g4, %g1 146 | add %g1, %g4, %g1 147 | cmp %i0, %g1 148 | be,pn %icc, .LL15 149 | sll %o5, 2, %g1 150 | add %g1, %o5, %g1 151 | cmp %i0, %g1 152 | bne,pt %icc, .LL8 153 | mov %i0, %o1 154 | call puts, 0 155 | mov %l4, %o0 156 | add %i0, 1, %i0 157 | .LL17: 158 | cmp %i0, 101 159 | be,pn %icc, .LL16 160 | nop 161 | .LL2: 162 | smul %i0, %l0, %g1 163 | srlx %g1, 32, %g1 164 | sra %g1, 1, %g1 165 | sra %i0, 31, %g2 166 | smul %i0, %l2, %g3 167 | srlx %g3, 32, %g3 168 | smul %i0, %l1, %g4 169 | srlx %g4, 32, %g4 170 | add %g3, %i0, %g3 171 | sub %g1, %g2, %o5 172 | sra %g3, 3, %g3 173 | sub %g3, %g2, %g3 174 | sll %g3, 4, %g1 175 | sub %g1, %g3, %g1 176 | cmp %i0, %g1 177 | bne,pt %icc, .LL3 178 | sub %g4, %g2, %g4 179 | call puts, 0 180 | mov %l3, %o0 181 | add %i0, 1, %i0 182 | cmp %i0, 101 183 | bne,pt %icc, .LL2 184 | nop 185 | .LL16: 186 | return %i7+8 187 | mov 0, %o0 188 | .LL8: 189 | call printf, 0 190 | mov %l5, %o0 191 | ba,pt %xcc, .LL17 192 | add %i0, 1, %i0 193 | .LL15: 194 | call puts, 0 195 | mov %l6, %o0 196 | ba,pt %xcc, .LL17 197 | add %i0, 1, %i0 198 | .size main, .-main 199 | .ident "GCC: (GNU) 4.2.1" 200 | #elif defined(__linux__) && defined(__i386__) 201 | .file "fizzbuzz.c" 202 | .section .rodata.str1.1,"aMS",@progbits,1 203 | .LC0: 204 | .string "FizzBuzz" 205 | .LC1: 206 | .string "Fizz" 207 | .LC2: 208 | .string "Buzz" 209 | .LC3: 210 | .string "%d\n" 211 | .section .text.startup,"ax",@progbits 212 | .p2align 4,,15 213 | .globl main 214 | .type main, @function 215 | main: 216 | .LFB13: 217 | .cfi_startproc 218 | pushl %ebp 219 | .cfi_def_cfa_offset 8 220 | .cfi_offset 5, -8 221 | movl %esp, %ebp 222 | .cfi_def_cfa_register 5 223 | pushl %edi 224 | .cfi_offset 7, -12 225 | movl $1431655766, %edi 226 | pushl %esi 227 | .cfi_offset 6, -16 228 | movl $-2004318071, %esi 229 | pushl %ebx 230 | .cfi_offset 3, -20 231 | movl $1, %ebx 232 | andl $-16, %esp 233 | subl $16, %esp 234 | jmp .L6 235 | .p2align 4,,7 236 | .p2align 3 237 | .L2: 238 | movl %ebx, %eax 239 | imull %edi 240 | subl %ecx, %edx 241 | leal (%edx,%edx,2), %eax 242 | cmpl %eax, %ebx 243 | je .L10 244 | movl %ebx, %eax 245 | movl $1717986919, %edx 246 | imull %edx 247 | sarl %edx 248 | subl %ecx, %edx 249 | leal (%edx,%edx,4), %eax 250 | cmpl %eax, %ebx 251 | jne .L5 252 | movl $.LC2, (%esp) 253 | call puts 254 | .L3: 255 | addl $1, %ebx 256 | cmpl $101, %ebx 257 | je .L11 258 | .L6: 259 | movl %ebx, %eax 260 | movl %ebx, %ecx 261 | imull %esi 262 | sarl $31, %ecx 263 | addl %ebx, %edx 264 | sarl $3, %edx 265 | subl %ecx, %edx 266 | movl %edx, %eax 267 | sall $4, %eax 268 | subl %edx, %eax 269 | cmpl %eax, %ebx 270 | jne .L2 271 | movl $.LC0, (%esp) 272 | addl $1, %ebx 273 | call puts 274 | cmpl $101, %ebx 275 | jne .L6 276 | .L11: 277 | leal -12(%ebp), %esp 278 | xorl %eax, %eax 279 | popl %ebx 280 | .cfi_remember_state 281 | .cfi_restore 3 282 | popl %esi 283 | .cfi_restore 6 284 | popl %edi 285 | .cfi_restore 7 286 | popl %ebp 287 | .cfi_restore 5 288 | .cfi_def_cfa 4, 4 289 | ret 290 | .p2align 4,,7 291 | .p2align 3 292 | .L5: 293 | .cfi_restore_state 294 | movl %ebx, 8(%esp) 295 | movl $.LC3, 4(%esp) 296 | movl $1, (%esp) 297 | call __printf_chk 298 | jmp .L3 299 | .p2align 4,,7 300 | .p2align 3 301 | .L10: 302 | movl $.LC1, (%esp) 303 | call puts 304 | jmp .L3 305 | .cfi_endproc 306 | .LFE13: 307 | .size main, .-main 308 | .ident "GCC: (Ubuntu/Linaro 4.7.0-7ubuntu3) 4.7.0" 309 | .section .note.GNU-stack,"",@progbits 310 | #elif defined(__linux__) && defined(__x86_64__) 311 | .file "fizzbuzz.c" 312 | .section .rodata.str1.1,"aMS",@progbits,1 313 | .LC0: 314 | .string "FizzBuzz" 315 | .LC1: 316 | .string "Fizz" 317 | .LC2: 318 | .string "Buzz" 319 | .LC3: 320 | .string "%d\n" 321 | .section .text.startup,"ax",@progbits 322 | .p2align 4,,15 323 | .globl main 324 | .type main, @function 325 | main: 326 | .LFB13: 327 | .cfi_startproc 328 | pushq %rbp 329 | .cfi_def_cfa_offset 16 330 | .cfi_offset 6, -16 331 | pushq %rbx 332 | .cfi_def_cfa_offset 24 333 | .cfi_offset 3, -24 334 | movl $-2004318071, %ebp 335 | movl $1, %ebx 336 | subq $8, %rsp 337 | .cfi_def_cfa_offset 32 338 | jmp .L6 339 | .p2align 4,,10 340 | .p2align 3 341 | .L2: 342 | movl %ebx, %eax 343 | movl $1431655766, %edx 344 | imull %edx 345 | subl %ecx, %edx 346 | leal (%rdx,%rdx,2), %eax 347 | cmpl %eax, %ebx 348 | je .L10 349 | movl %ebx, %eax 350 | movl $1717986919, %edx 351 | imull %edx 352 | sarl %edx 353 | subl %ecx, %edx 354 | leal (%rdx,%rdx,4), %eax 355 | cmpl %eax, %ebx 356 | jne .L5 357 | leaq .LC2(%rip), %rdi 358 | call puts@PLT 359 | .L3: 360 | addl $1, %ebx 361 | cmpl $101, %ebx 362 | je .L11 363 | .L6: 364 | movl %ebx, %eax 365 | movl %ebx, %ecx 366 | imull %ebp 367 | sarl $31, %ecx 368 | addl %ebx, %edx 369 | sarl $3, %edx 370 | subl %ecx, %edx 371 | movl %edx, %eax 372 | sall $4, %eax 373 | subl %edx, %eax 374 | cmpl %eax, %ebx 375 | jne .L2 376 | leaq .LC0(%rip), %rdi 377 | addl $1, %ebx 378 | call puts@PLT 379 | cmpl $101, %ebx 380 | jne .L6 381 | .L11: 382 | addq $8, %rsp 383 | .cfi_remember_state 384 | .cfi_def_cfa_offset 24 385 | xorl %eax, %eax 386 | popq %rbx 387 | .cfi_def_cfa_offset 16 388 | popq %rbp 389 | .cfi_def_cfa_offset 8 390 | ret 391 | .p2align 4,,10 392 | .p2align 3 393 | .L5: 394 | .cfi_restore_state 395 | leaq .LC3(%rip), %rsi 396 | movl %ebx, %edx 397 | movl $1, %edi 398 | xorl %eax, %eax 399 | call __printf_chk@PLT 400 | jmp .L3 401 | .p2align 4,,10 402 | .p2align 3 403 | .L10: 404 | leaq .LC1(%rip), %rdi 405 | call puts@PLT 406 | jmp .L3 407 | .cfi_endproc 408 | .LFE13: 409 | .size main, .-main 410 | .ident "GCC: (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005" 411 | .section .note.GNU-stack,"",@progbits 412 | #else 413 | #error Unrecognized architecture 414 | #endif 415 | -------------------------------------------------------------------------------- /sh6-bug/sh6-bug.bash.out: -------------------------------------------------------------------------------- 1 | % mkdir src 2 | % cd src 3 | % git clone https://github.com/JNeitzel/v6shell.git 4 | Cloning into 'v6shell'... 5 | % cd v6shell 6 | % git log -n 1 7 | commit 38e29b34dd5d481dfba4d8cc94632bf9a5c642f9 (HEAD -> current, origin/current, origin/HEAD) 8 | Author: Jeff Neitzel 9 | Date: 2016-12-17 18:15:34 +0000 10 | 11 | Fix external goto for sh6 on Ubuntu 16.xx 12 | 13 | This comes with a performance penalty by using read(2) instead 14 | of getchar(3), but the penalty is not very noticeable in the 15 | real world. 16 | 17 | NOTE: This does not fix the true cause of whatever the problem 18 | is with lseek(2) on Ubuntu 16.xx. 19 | % export PREFIX=/tmp/sh6-bug-2722/install 20 | % make 21 | /bin/sh ./mkconfig 22 | mkconfig: PATH_LOGIN == "/bin/login" 23 | Modify value in "config.h" if this is incorrect. 24 | mkconfig: PATH_NEWGRP == "/usr/bin/newgrp" 25 | Modify value in "config.h" if this is incorrect. 26 | make[1]: Entering directory '/tmp/sh6-bug-2722/src/v6shell' 27 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' v.c 28 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' osh.c 29 | osh.c: In function ‘source_open’: 30 | osh.c:2560:4: warning: ignoring return value of ‘writev’, declared with attribute warn_unused_result [-Wunused-result] 31 | (void)writev(FD2, msg, 6); 32 | ^~~~~~~~~~~~~~~~~~~~~~~~~ 33 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' err.c 34 | err.c: In function ‘wmsg’: 35 | err.c:254:5: warning: ignoring return value of ‘writev’, declared with attribute warn_unused_result [-Wunused-result] 36 | (void)writev(FD2, ev, 4); 37 | ^~~~~~~~~~~~~~~~~~~~~~~~ 38 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' lib.c 39 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' util.c 40 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' pexec.c 41 | pexec.c: In function ‘pexec’: 42 | pexec.c:143:4: warning: ignoring return value of ‘writev’, declared with attribute warn_unused_result [-Wunused-result] 43 | (void)writev(FD2, msg, 3); 44 | ^~~~~~~~~~~~~~~~~~~~~~~~~ 45 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' sasignal.c 46 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' strtoint.c 47 | cc -o osh v.o osh.o err.o lib.o util.o pexec.o sasignal.o strtoint.o 48 | make[1]: Leaving directory '/tmp/sh6-bug-2722/src/v6shell' 49 | sed -e 's|@OSH_DATE@|December 15, 2016|' -e 's|@OSH_VERSION@|osh-current|' -e 's|@LIBEXECDIROSH@|/tmp/sh6-bug-2722/install/libexec/osh-current/osh|' -e 's|@LIBEXECDIRSH6@|/tmp/sh6-bug-2722/install/libexec/osh-current/sh6|' -e 's|@SYSCONFDIR@|/tmp/sh6-bug-2722/install/etc|' osh.1.out 50 | sed -e 's|@OSH_DATE@|December 15, 2016|' -e 's|@OSH_VERSION@|osh-current|' -e 's|@LIBEXECDIROSH@|/tmp/sh6-bug-2722/install/libexec/osh-current/osh|' -e 's|@LIBEXECDIRSH6@|/tmp/sh6-bug-2722/install/libexec/osh-current/sh6|' -e 's|@SYSCONFDIR@|/tmp/sh6-bug-2722/install/etc|' fd2.1.out 51 | sed -e 's|@OSH_DATE@|December 15, 2016|' -e 's|@OSH_VERSION@|osh-current|' -e 's|@LIBEXECDIROSH@|/tmp/sh6-bug-2722/install/libexec/osh-current/osh|' -e 's|@LIBEXECDIRSH6@|/tmp/sh6-bug-2722/install/libexec/osh-current/sh6|' -e 's|@SYSCONFDIR@|/tmp/sh6-bug-2722/install/etc|' goto.1.out 52 | sed -e 's|@OSH_DATE@|December 15, 2016|' -e 's|@OSH_VERSION@|osh-current|' -e 's|@LIBEXECDIROSH@|/tmp/sh6-bug-2722/install/libexec/osh-current/osh|' -e 's|@LIBEXECDIRSH6@|/tmp/sh6-bug-2722/install/libexec/osh-current/sh6|' -e 's|@SYSCONFDIR@|/tmp/sh6-bug-2722/install/etc|' if.1.out 53 | make[1]: Entering directory '/tmp/sh6-bug-2722/src/v6shell' 54 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' sh6.c 55 | cc -o sh6 v.o sh6.o err.o pexec.o sasignal.o 56 | make[1]: Leaving directory '/tmp/sh6-bug-2722/src/v6shell' 57 | make[1]: Entering directory '/tmp/sh6-bug-2722/src/v6shell' 58 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' glob.c 59 | cc -o glob v.o glob.o err.o pexec.o 60 | make[1]: Leaving directory '/tmp/sh6-bug-2722/src/v6shell' 61 | sed -e 's|@OSH_DATE@|December 15, 2016|' -e 's|@OSH_VERSION@|osh-current|' -e 's|@LIBEXECDIROSH@|/tmp/sh6-bug-2722/install/libexec/osh-current/osh|' -e 's|@LIBEXECDIRSH6@|/tmp/sh6-bug-2722/install/libexec/osh-current/sh6|' -e 's|@SYSCONFDIR@|/tmp/sh6-bug-2722/install/etc|' sh6.1.out 62 | sed -e 's|@OSH_DATE@|December 15, 2016|' -e 's|@OSH_VERSION@|osh-current|' -e 's|@LIBEXECDIROSH@|/tmp/sh6-bug-2722/install/libexec/osh-current/osh|' -e 's|@LIBEXECDIRSH6@|/tmp/sh6-bug-2722/install/libexec/osh-current/sh6|' -e 's|@SYSCONFDIR@|/tmp/sh6-bug-2722/install/etc|' glob.1.out 63 | make[1]: Entering directory '/tmp/sh6-bug-2722/src/v6shell' 64 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' fd2.c 65 | cc -o fd2 v.o fd2.o err.o pexec.o 66 | make[1]: Leaving directory '/tmp/sh6-bug-2722/src/v6shell' 67 | make[1]: Entering directory '/tmp/sh6-bug-2722/src/v6shell' 68 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' goto.c 69 | cc -o goto v.o goto.o err.o 70 | make[1]: Leaving directory '/tmp/sh6-bug-2722/src/v6shell' 71 | make[1]: Entering directory '/tmp/sh6-bug-2722/src/v6shell' 72 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2722/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2722/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2722/install/etc"' if.c 73 | cc -o if v.o if.o err.o pexec.o sasignal.o strtoint.o 74 | make[1]: Leaving directory '/tmp/sh6-bug-2722/src/v6shell' 75 | % make install 76 | test -d /tmp/sh6-bug-2722/install/bin || { umask 0022 && mkdir -p /tmp/sh6-bug-2722/install/bin ; } 77 | test -d /tmp/sh6-bug-2722/install/man/man1 || { umask 0022 && mkdir -p /tmp/sh6-bug-2722/install/man/man1 ; } 78 | /usr/bin/install -c -s -m 0555 osh /tmp/sh6-bug-2722/install/bin 79 | /usr/bin/install -c -m 0444 osh.1.out /tmp/sh6-bug-2722/install/man/man1/osh.1 80 | /usr/bin/install -c -m 0444 fd2.1.out /tmp/sh6-bug-2722/install/man/man1/fd2.1 81 | /usr/bin/install -c -m 0444 goto.1.out /tmp/sh6-bug-2722/install/man/man1/goto.1 82 | /usr/bin/install -c -m 0444 if.1.out /tmp/sh6-bug-2722/install/man/man1/if.1 83 | test -d /tmp/sh6-bug-2722/install/libexec/osh-current || { umask 0022 && mkdir -p /tmp/sh6-bug-2722/install/libexec/osh-current ; } 84 | /usr/bin/install -c -m 0444 README.libexec /tmp/sh6-bug-2722/install/libexec/osh-current/README 85 | test -d /tmp/sh6-bug-2722/install/libexec/osh-current/osh || { umask 0022 && mkdir -p /tmp/sh6-bug-2722/install/libexec/osh-current/osh ; } 86 | /usr/bin/install -c -m 0444 libexec.osh/README /tmp/sh6-bug-2722/install/libexec/osh-current/osh 87 | /usr/bin/install -c -m 0555 libexec.osh/history /tmp/sh6-bug-2722/install/libexec/osh-current/osh 88 | /usr/bin/install -c -m 0444 libexec.osh/history.help /tmp/sh6-bug-2722/install/libexec/osh-current/osh 89 | test -d /tmp/sh6-bug-2722/install/libexec/osh-current/sh6 || { umask 0022 && mkdir -p /tmp/sh6-bug-2722/install/libexec/osh-current/sh6 ; } 90 | /usr/bin/install -c -m 0444 README.libexec.sh6 /tmp/sh6-bug-2722/install/libexec/osh-current/sh6/README 91 | /usr/bin/install -c -s -m 0555 sh6 /tmp/sh6-bug-2722/install/bin 92 | /usr/bin/install -c -m 0444 sh6.1.out /tmp/sh6-bug-2722/install/man/man1/sh6.1 93 | /usr/bin/install -c -s -m 0555 glob /tmp/sh6-bug-2722/install/libexec/osh-current/sh6 94 | /usr/bin/install -c -m 0444 glob.1.out /tmp/sh6-bug-2722/install/man/man1/glob.1 95 | /usr/bin/install -c -s -m 0555 fd2 /tmp/sh6-bug-2722/install/libexec/osh-current/sh6 96 | /usr/bin/install -c -s -m 0555 goto /tmp/sh6-bug-2722/install/libexec/osh-current/sh6 97 | /usr/bin/install -c -s -m 0555 if /tmp/sh6-bug-2722/install/libexec/osh-current/sh6 98 | % mkdir /tmp/sh6-bug-2722/test 99 | % cd /tmp/sh6-bug-2722/test 100 | % cat test.sh6 101 | #!/tmp/sh6-bug-2722/install/bin/sh6 102 | 103 | echo one 104 | goto LABEL 105 | echo two 106 | : LABEL 107 | echo three 108 | % ./test.sh6 109 | one 110 | wo: not found 111 | % rm -rf /tmp/sh6-bug-2722 112 | -------------------------------------------------------------------------------- /sh6-bug/sh6-bug.bash-strace.out: -------------------------------------------------------------------------------- 1 | % mkdir src 2 | % cd src 3 | % git clone https://github.com/JNeitzel/v6shell.git 4 | Cloning into 'v6shell'... 5 | % cd v6shell 6 | % git log -n 1 7 | commit 38e29b34dd5d481dfba4d8cc94632bf9a5c642f9 (HEAD -> current, origin/current, origin/HEAD) 8 | Author: Jeff Neitzel 9 | Date: 2016-12-17 18:15:34 +0000 10 | 11 | Fix external goto for sh6 on Ubuntu 16.xx 12 | 13 | This comes with a performance penalty by using read(2) instead 14 | of getchar(3), but the penalty is not very noticeable in the 15 | real world. 16 | 17 | NOTE: This does not fix the true cause of whatever the problem 18 | is with lseek(2) on Ubuntu 16.xx. 19 | % export PREFIX=/tmp/sh6-bug-2879/install 20 | % make 21 | /bin/sh ./mkconfig 22 | mkconfig: PATH_LOGIN == "/bin/login" 23 | Modify value in "config.h" if this is incorrect. 24 | mkconfig: PATH_NEWGRP == "/usr/bin/newgrp" 25 | Modify value in "config.h" if this is incorrect. 26 | make[1]: Entering directory '/tmp/sh6-bug-2879/src/v6shell' 27 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' v.c 28 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' osh.c 29 | osh.c: In function ‘source_open’: 30 | osh.c:2560:4: warning: ignoring return value of ‘writev’, declared with attribute warn_unused_result [-Wunused-result] 31 | (void)writev(FD2, msg, 6); 32 | ^~~~~~~~~~~~~~~~~~~~~~~~~ 33 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' err.c 34 | err.c: In function ‘wmsg’: 35 | err.c:254:5: warning: ignoring return value of ‘writev’, declared with attribute warn_unused_result [-Wunused-result] 36 | (void)writev(FD2, ev, 4); 37 | ^~~~~~~~~~~~~~~~~~~~~~~~ 38 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' lib.c 39 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' util.c 40 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' pexec.c 41 | pexec.c: In function ‘pexec’: 42 | pexec.c:143:4: warning: ignoring return value of ‘writev’, declared with attribute warn_unused_result [-Wunused-result] 43 | (void)writev(FD2, msg, 3); 44 | ^~~~~~~~~~~~~~~~~~~~~~~~~ 45 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' sasignal.c 46 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' strtoint.c 47 | cc -o osh v.o osh.o err.o lib.o util.o pexec.o sasignal.o strtoint.o 48 | make[1]: Leaving directory '/tmp/sh6-bug-2879/src/v6shell' 49 | sed -e 's|@OSH_DATE@|December 15, 2016|' -e 's|@OSH_VERSION@|osh-current|' -e 's|@LIBEXECDIROSH@|/tmp/sh6-bug-2879/install/libexec/osh-current/osh|' -e 's|@LIBEXECDIRSH6@|/tmp/sh6-bug-2879/install/libexec/osh-current/sh6|' -e 's|@SYSCONFDIR@|/tmp/sh6-bug-2879/install/etc|' osh.1.out 50 | sed -e 's|@OSH_DATE@|December 15, 2016|' -e 's|@OSH_VERSION@|osh-current|' -e 's|@LIBEXECDIROSH@|/tmp/sh6-bug-2879/install/libexec/osh-current/osh|' -e 's|@LIBEXECDIRSH6@|/tmp/sh6-bug-2879/install/libexec/osh-current/sh6|' -e 's|@SYSCONFDIR@|/tmp/sh6-bug-2879/install/etc|' fd2.1.out 51 | sed -e 's|@OSH_DATE@|December 15, 2016|' -e 's|@OSH_VERSION@|osh-current|' -e 's|@LIBEXECDIROSH@|/tmp/sh6-bug-2879/install/libexec/osh-current/osh|' -e 's|@LIBEXECDIRSH6@|/tmp/sh6-bug-2879/install/libexec/osh-current/sh6|' -e 's|@SYSCONFDIR@|/tmp/sh6-bug-2879/install/etc|' goto.1.out 52 | sed -e 's|@OSH_DATE@|December 15, 2016|' -e 's|@OSH_VERSION@|osh-current|' -e 's|@LIBEXECDIROSH@|/tmp/sh6-bug-2879/install/libexec/osh-current/osh|' -e 's|@LIBEXECDIRSH6@|/tmp/sh6-bug-2879/install/libexec/osh-current/sh6|' -e 's|@SYSCONFDIR@|/tmp/sh6-bug-2879/install/etc|' if.1.out 53 | make[1]: Entering directory '/tmp/sh6-bug-2879/src/v6shell' 54 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' sh6.c 55 | cc -o sh6 v.o sh6.o err.o pexec.o sasignal.o 56 | make[1]: Leaving directory '/tmp/sh6-bug-2879/src/v6shell' 57 | make[1]: Entering directory '/tmp/sh6-bug-2879/src/v6shell' 58 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' glob.c 59 | cc -o glob v.o glob.o err.o pexec.o 60 | make[1]: Leaving directory '/tmp/sh6-bug-2879/src/v6shell' 61 | sed -e 's|@OSH_DATE@|December 15, 2016|' -e 's|@OSH_VERSION@|osh-current|' -e 's|@LIBEXECDIROSH@|/tmp/sh6-bug-2879/install/libexec/osh-current/osh|' -e 's|@LIBEXECDIRSH6@|/tmp/sh6-bug-2879/install/libexec/osh-current/sh6|' -e 's|@SYSCONFDIR@|/tmp/sh6-bug-2879/install/etc|' sh6.1.out 62 | sed -e 's|@OSH_DATE@|December 15, 2016|' -e 's|@OSH_VERSION@|osh-current|' -e 's|@LIBEXECDIROSH@|/tmp/sh6-bug-2879/install/libexec/osh-current/osh|' -e 's|@LIBEXECDIRSH6@|/tmp/sh6-bug-2879/install/libexec/osh-current/sh6|' -e 's|@SYSCONFDIR@|/tmp/sh6-bug-2879/install/etc|' glob.1.out 63 | make[1]: Entering directory '/tmp/sh6-bug-2879/src/v6shell' 64 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' fd2.c 65 | cc -o fd2 v.o fd2.o err.o pexec.o 66 | make[1]: Leaving directory '/tmp/sh6-bug-2879/src/v6shell' 67 | make[1]: Entering directory '/tmp/sh6-bug-2879/src/v6shell' 68 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' goto.c 69 | cc -o goto v.o goto.o err.o 70 | make[1]: Leaving directory '/tmp/sh6-bug-2879/src/v6shell' 71 | make[1]: Entering directory '/tmp/sh6-bug-2879/src/v6shell' 72 | cc -c -Os -std=c99 -pedantic -Wall -Wextra -DOSH_VERSION='"osh-current"' -DLIBEXECDIROSH='"/tmp/sh6-bug-2879/install/libexec/osh-current/osh"' -DLIBEXECDIRSH6='"/tmp/sh6-bug-2879/install/libexec/osh-current/sh6"' -DSYSCONFDIR='"/tmp/sh6-bug-2879/install/etc"' if.c 73 | cc -o if v.o if.o err.o pexec.o sasignal.o strtoint.o 74 | make[1]: Leaving directory '/tmp/sh6-bug-2879/src/v6shell' 75 | % make install 76 | test -d /tmp/sh6-bug-2879/install/bin || { umask 0022 && mkdir -p /tmp/sh6-bug-2879/install/bin ; } 77 | test -d /tmp/sh6-bug-2879/install/man/man1 || { umask 0022 && mkdir -p /tmp/sh6-bug-2879/install/man/man1 ; } 78 | /usr/bin/install -c -s -m 0555 osh /tmp/sh6-bug-2879/install/bin 79 | /usr/bin/install -c -m 0444 osh.1.out /tmp/sh6-bug-2879/install/man/man1/osh.1 80 | /usr/bin/install -c -m 0444 fd2.1.out /tmp/sh6-bug-2879/install/man/man1/fd2.1 81 | /usr/bin/install -c -m 0444 goto.1.out /tmp/sh6-bug-2879/install/man/man1/goto.1 82 | /usr/bin/install -c -m 0444 if.1.out /tmp/sh6-bug-2879/install/man/man1/if.1 83 | test -d /tmp/sh6-bug-2879/install/libexec/osh-current || { umask 0022 && mkdir -p /tmp/sh6-bug-2879/install/libexec/osh-current ; } 84 | /usr/bin/install -c -m 0444 README.libexec /tmp/sh6-bug-2879/install/libexec/osh-current/README 85 | test -d /tmp/sh6-bug-2879/install/libexec/osh-current/osh || { umask 0022 && mkdir -p /tmp/sh6-bug-2879/install/libexec/osh-current/osh ; } 86 | /usr/bin/install -c -m 0444 libexec.osh/README /tmp/sh6-bug-2879/install/libexec/osh-current/osh 87 | /usr/bin/install -c -m 0555 libexec.osh/history /tmp/sh6-bug-2879/install/libexec/osh-current/osh 88 | /usr/bin/install -c -m 0444 libexec.osh/history.help /tmp/sh6-bug-2879/install/libexec/osh-current/osh 89 | test -d /tmp/sh6-bug-2879/install/libexec/osh-current/sh6 || { umask 0022 && mkdir -p /tmp/sh6-bug-2879/install/libexec/osh-current/sh6 ; } 90 | /usr/bin/install -c -m 0444 README.libexec.sh6 /tmp/sh6-bug-2879/install/libexec/osh-current/sh6/README 91 | /usr/bin/install -c -s -m 0555 sh6 /tmp/sh6-bug-2879/install/bin 92 | /usr/bin/install -c -m 0444 sh6.1.out /tmp/sh6-bug-2879/install/man/man1/sh6.1 93 | /usr/bin/install -c -s -m 0555 glob /tmp/sh6-bug-2879/install/libexec/osh-current/sh6 94 | /usr/bin/install -c -m 0444 glob.1.out /tmp/sh6-bug-2879/install/man/man1/glob.1 95 | /usr/bin/install -c -s -m 0555 fd2 /tmp/sh6-bug-2879/install/libexec/osh-current/sh6 96 | /usr/bin/install -c -s -m 0555 goto /tmp/sh6-bug-2879/install/libexec/osh-current/sh6 97 | /usr/bin/install -c -s -m 0555 if /tmp/sh6-bug-2879/install/libexec/osh-current/sh6 98 | % mkdir /tmp/sh6-bug-2879/test 99 | % cd /tmp/sh6-bug-2879/test 100 | % cat test.sh6 101 | #!/tmp/sh6-bug-2879/install/bin/sh6 102 | 103 | echo one 104 | strace -o goto.strace /tmp/sh6-bug-2879/install/libexec/osh-current/sh6/goto LABEL 105 | echo two 106 | : LABEL 107 | echo three 108 | % ./test.sh6 109 | one 110 | wo: not found 111 | % cat goto.strace 112 | execve("/tmp/sh6-bug-2879/install/libexec/osh-current/sh6/goto", ["/tmp/sh6-bug-2879/install/libexe"..., "LABEL"], [/* 55 vars */]) = 0 113 | brk(NULL) = 0x559b4d7d8000 114 | access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) 115 | mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbb553fa000 116 | access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) 117 | open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 118 | fstat(3, {st_mode=S_IFREG|0644, st_size=147325, ...}) = 0 119 | mmap(NULL, 147325, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbb553d6000 120 | close(3) = 0 121 | access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) 122 | open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 123 | read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\5\2\0\0\0\0\0"..., 832) = 832 124 | fstat(3, {st_mode=S_IFREG|0755, st_size=1856752, ...}) = 0 125 | mmap(NULL, 3959200, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbb54e12000 126 | mprotect(0x7fbb54fcf000, 2097152, PROT_NONE) = 0 127 | mmap(0x7fbb551cf000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bd000) = 0x7fbb551cf000 128 | mmap(0x7fbb551d5000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbb551d5000 129 | close(3) = 0 130 | mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbb553d4000 131 | arch_prctl(ARCH_SET_FS, 0x7fbb553d4700) = 0 132 | mprotect(0x7fbb551cf000, 16384, PROT_READ) = 0 133 | mprotect(0x559b4c55d000, 4096, PROT_READ) = 0 134 | mprotect(0x7fbb553fd000, 4096, PROT_READ) = 0 135 | munmap(0x7fbb553d6000, 147325) = 0 136 | getpid() = 3035 137 | ioctl(0, TCGETS, 0x7ffc16f9c250) = -1 ENOTTY (Inappropriate ioctl for device) 138 | lseek(0, 0, SEEK_SET) = 0 139 | fstat(0, {st_mode=S_IFREG|0755, st_size=157, ...}) = 0 140 | brk(NULL) = 0x559b4d7d8000 141 | brk(0x559b4d7fa000) = 0x559b4d7fa000 142 | read(0, "#!/tmp/sh6-bug-2879/install/bin/"..., 4096) = 157 143 | lseek(0, 146, SEEK_SET) = 146 144 | lseek(0, -11, SEEK_CUR) = 135 145 | exit_group(0) = ? 146 | +++ exited with 0 +++ 147 | % rm -rf /tmp/sh6-bug-2879 148 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | FizzBuzz is a nearly trivial programming exercise, sometimes used in 2 | job interviews to weed out candidates who say they can program but 3 | really can't. 4 | 5 | References: 6 | 7 | * [Using FizzBuzz to Find Developers who Grok Coding](http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/) by Imran Ghory 8 | * [Why Can't Programmers.. Program?](http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html) by Jeff Atwood 9 | * [The Problem with the FizzBuzz Problem](https://www.gayle.com/blog/2015/5/31/the-problem-with-the-fizzbuzz-problem) by Gayle Laakmann McDowell 10 | * [FizzBuzz Still Works](https://www.globalnerdy.com/2012/11/15/fizzbuzz-still-works/) by Joey deVilla 11 | * [Further Into FizzBuzz!](https://www.globalnerdy.com/2012/11/16/further-into-fizzbuzz/) by Joey deVilla 12 | 13 | The requirements are simple: 14 | 15 | > Write a program that prints the numbers from 1 to 100. But for multiples 16 | > of three print "Fizz" instead of the number and for the multiples of 17 | > five print "Buzz". For numbers which are multiples of both three and 18 | > five print "FizzBuzz". 19 | 20 | In my [fizzbuz-c](https://github.com/Keith-S-Thompson/fizzbuzz-c) project 21 | I present multiple (139 at last count) C solutions. 22 | 23 | **NOTE :** This is not intended as a collaborative project. It is my 24 | own personal playground. A few people have submitted pull requests for 25 | languages I haven't covered, which I certainly appreciate, but I won't 26 | be accepting them. If you're interested in collaborating on something 27 | similar, see [Rosetta Code](http://rosettacode.org/wiki/Rosetta_Code). 28 | Bug reports are quite welcome. 29 | 30 | Here I present multiple implementations, one in each language. 31 | The current set of languages (112 of them) is: 32 | 33 | - [Ada](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.adb) 34 | - [Algol 60](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.a60) 35 | - [Algol 68](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.a68) 36 | - [Aribas](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.aribas) 37 | - [Awk](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.awk) 38 | - [B](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.b) 39 | - [BASIC (bwBASIC)](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.bas) 40 | - [Bash](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.bash) 41 | - [bc](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.bc) 42 | - [Bourne shell](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.sh) 43 | - [Bython](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.by) 44 | - [C](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.c) 45 | - [C#](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.cs) 46 | - [C++](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.cpp) 47 | - [C3](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.c3) 48 | - [C-shell](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.csh) 49 | - [calc](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.calc) 50 | - [cat](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.cat) 51 | - [Clojure](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.clojure) 52 | - [COBOL](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.cob) 53 | - [Common Lisp](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.clisp) 54 | - [Crystal](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.cr) 55 | - [curl](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.curl) 56 | - [D](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.d) 57 | - [Dart](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.dart) 58 | - [ed](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.ed) 59 | - [Elvish](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.elvish) 60 | - [Emacs Lisp](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.elisp) 61 | - [Erlang (using escript)](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.erl) 62 | - [Falcon](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.fal) 63 | - [Fish](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.fish) 64 | - [FizzBuzz](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.fizzbuzz) 65 | - [Forth](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.fs) 66 | - [FORTRAN 66](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.f66) 67 | - [FORTRAN 77](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.f) 68 | - [Fortran 90](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.f90) 69 | - [G-Portugol](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.gpt) 70 | - [gcc error messages](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.gcc) 71 | - [gdb](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.gdb) 72 | - [Go](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.go) 73 | - [Gravity](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.gravity) 74 | - [Groovy](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.groovy) 75 | - [Guile](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.guile) 76 | - [Haskell](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.hs) 77 | - [Haxe](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.hx) 78 | - [Hodor](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.hodor) 79 | - [Icon](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.icn) 80 | - [Io](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.io) 81 | - [Java](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.java) 82 | - [JavaScript](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.js) 83 | - [Julia](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.jl) 84 | - [Kotlin](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.kt) 85 | - [Lily](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.lily) 86 | - [Little](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.l) 87 | - [Logo](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.logo) 88 | - [LOLCODE](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.lol) 89 | - [Lua](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.lua) 90 | - [M4](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.m4) 91 | - [Make](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.mk) 92 | - [Modula-2](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.mod) 93 | - [Myrddin](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.myr) 94 | - [Nickle](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.nickle) 95 | - [Nim (formerly Nimrod)](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.nim) 96 | - [Node.js (JavaScript)](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.nodejs) 97 | - [NQP](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.nqp) 98 | - [Objective-C](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.m) 99 | - [Octave](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.octave) (should be compatible with Matlab) 100 | - [PARI/GP](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.gp) 101 | - [PHP](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.php) 102 | - [Pascal](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.pas) 103 | - [Perl 5](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.pl) 104 | - [PL/I](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.pli) 105 | - [PicoLisp](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.picolisp) 106 | - [Pike](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.pike) 107 | - [PostScript](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.ps) 108 | - [PowerShell](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.ps1) 109 | - [Pure](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.pure) 110 | - [Python 2](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.py2) 111 | - [Python 3](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.py3) 112 | - [R](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.r) 113 | - [Raku](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.raku) 114 | - [Ratfor](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.ratfor) 115 | - [Rc (Plan 9 shell)](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.rc) 116 | - [REXX](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.rexx) 117 | - [Ruby](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.rb) 118 | - [Rust](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.rs) 119 | - [S-Lang](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.sl) 120 | - [Scala](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.scala) 121 | - [sed](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.sed) 122 | - [Seed7](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.sd7) 123 | - [SETL](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.setl) 124 | - [Simula](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.sim) 125 | - [Smalltalk](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.st) 126 | - [SQLite3](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.sqlite3) 127 | - [Squirrel](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.squirrel) 128 | - [Swift](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.swift) 129 | - [Tab](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.tab) 130 | - [tail](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.tail) 131 | - [Tcl](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.tcl) 132 | - [Thompson Shell](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.sh6) 133 | - [TypeScript](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.ts) 134 | - [V](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.v) 135 | - [Vala](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.vala) 136 | - [Vigil](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.vg) 137 | - [Vimscript](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.vim) 138 | - [Visual Basic .NET](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.vb) 139 | - [Whitespace](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.ws) 140 | - [Wren](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.wren) 141 | - [x86/x86_64/SPARC assembly](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.sx) 142 | - [XPL](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.xpl) 143 | - [Zig](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.zig) 144 | - [Zsh](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.zsh) 145 | 146 | Many of these are inspired by http://99-bottles-of-beer.net/. 147 | 148 | `tail` and `cat` are simply the standard Unix/Linux utilities, not real 149 | scripting languages. The `cat` implementation in particular is an ugly 150 | cheat, depending on the existence of the `expected-output.txt` file. 151 | 152 | JavaScript and Node.js aren't really distinct languages, but Node.js 153 | is a sufficiently different environment than plain JavaScript that 154 | I thought it was worth having both. 155 | 156 | `curl` is a URL transfer utility, not a programming language. 157 | `fizzbuzz.curl`, like `fizzbuzz.cat`, depends on the existence 158 | of `expected-output.txt`, but on this [`GitHub` project 159 | page](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot) rather 160 | than in the current directory. It also requires an Internet connection. 161 | 162 | The `verify` script executes each program and confirms that its output 163 | is correct. All programs pass on Ubuntu 24.04.2 LTS. 164 | 165 | `fizzbuzz.b` is not tested with an actual B compiler; see that file 166 | for details. 167 | 168 | `fizzbuzz.sh6` failed due to a problem with the external `goto` command. 169 | I'm in touch with the maintainer to (I hope) get a fix for this. See 170 | the `sh6-bug` subdirectory for details. (For now I've worked around 171 | this problem by using `osh` rather than `sh6`. `osh` is an enhanced 172 | implementation of `sh6` that has `goto` as a built-in command.) 173 | 174 | The [Whitespace web page](http://compsoc.dur.ac.uk/whitespace/) 175 | is currently down, so I'm using the Perl implementation from 176 | [here](https://github.com/hostilefork/whitespacers/). I'll update 177 | the "comments" in the source file later (that's difficult to do, 178 | since I have to preserve existing whitespace). 179 | 180 | I'm keeping an informal list of languages I intend to add in 181 | [TODO.md](https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/TODO.md). 182 | 183 | Do not take this too seriously. 184 | --------------------------------------------------------------------------------