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