#! /bin/usr/env ruby # HelloWorldFizzBuzz module HelloWorldFizzBuzz # Sqlite database Module module Sqlite def connect_database @db = Sequel.sqlite # create an items table begin @db.create_table :list do primary_key :id String :language String :helloworld String :fizzbuzz end end # create a dataset from the items table @posts = @db[:list] # populate the table ## Add hello-world && fizz-buzz examples Below (In Alphabetic Order) ### A ### B ### C ### D ### E ### F ### G ### H ### I ### J ### K ### L ### M ### N ### O ### P @posts.insert(language: 'php', helloworld: "", fizzbuzz: " for ($i = 1; $i <= 100; $i++) { if($i % 3 == 0 && $i % 5 ==0){ echo 'FizzBuzz
'; } else if($i % 3 == 0){ echo 'Fizz
'; } else if($i % 5 == 0){ echo 'Buzz
'; } else { echo $i.'
''; } } ") ### Q ### R @posts.insert(language: 'ruby', helloworld: "puts 'Hello, world!'", fizzbuzz: " def fizzbuzz(n) (1..n).each do |i| if i % 3 == 0 && i % 5 == 0 puts 'fizzbuzz' elsif i % 3 == 0 puts 'fizz' elsif i % 5 == 0 puts 'buzz' else puts i end end end fizzbuzz(100)") ### S ### T ### U ### V ### W ### X ### Y ### Z end end end