<?php
try{
echo 'Start con career';
while(1) {
attemptCon();
}
} catch(Exception $e) {
echo $e->getMessage();
echo 'Work for FBI';
}
function attemptCon() {
$cons = array(
'Confidence trick',
'Check fraud',
'Imposter',
'Escape'
);
if(rand(0,100) > 75) {
throw new Exception('Arrest Frank Abagnale');
} else {
echo $cons[rand(0, (count($cons) - 1))].' con successful!';
}
}
?>
try{
echo 'Start con career';
while(1) {
attemptCon();
}
} catch(Exception $e) {
echo $e->getMessage();
echo 'Work for FBI';
}
function attemptCon() {
$cons = array(
'Confidence trick',
'Check fraud',
'Imposter',
'Escape'
);
if(rand(0,100) > 75) {
throw new Exception('Arrest Frank Abagnale');
} else {
echo $cons[rand(0, (count($cons) - 1))].' con successful!';
}
}
?>