Oliver's Ordering System for Receiver Coffee

Peter Rukavina
Audio file
#!/usr/bin/php
<?php

$hotchocolate = 1;
$carmelsteamers = 1;
$vanillasteamers = 1;
$something = true;

while ($something == true) {
  exec ("say -v 'victoria' welcome to reciever coffee. what would you like?");
  exec ("say i would like hot chocolate");
  if ($hotchocolate > 0) {
    $having = "okay there is hot chocolate";
    $hotchocolate--;  
  }
  elseif ($carmelsteamers > 0) {
    exec("say -v 'victoria' sorry there is no hot chocolate");
    exec ("say i would like a carmel steamer");
    $having = "okay there are carmel steamers" ;
    $carmelsteamers--;
  }
  elseif ($vanillasteamers > 0) {
    exec("say -v 'victoria' sorry there is no hot chocolate and carmel steamers");
    exec ("say i would like a vanilla steamer");
    $having = "okay there are vannilla steamers";
    $vanillasteamers--;
  }
  else {
    $having = "no drinks available";
    $something = false;
  }
  exec("say -v 'victoria' $having");
}

 

Add new comment

Plain text

  • Allowed HTML tags: <b> <i> <em> <strong> <blockquote> <code> <ul> <ol> <li>
  • Lines and paragraphs break automatically.

About This Blog

Photo of Peter RukavinaI am . I am a writer, letterpress printer, and a curious person.

To learn more about me, read my /nowlook at my bio, listen to audio I’ve posted, read presentations and speeches I’ve written, or get in touch (peter@rukavina.net is the quickest way). 

You can subscribe to an RSS feed of posts, an RSS feed of comments, or a podcast RSS feed that just contains audio posts. You can also receive a daily digests of posts by email.

Search