Dice Rolling Simulation

时间:2015-05-12 22:28:42

标签: java eclipse

I'm wondering how I could get my dice rolling simulator to stop when it your total roll is one of 2 certain numbers, (example: rolling will stop when you reach a total roll of 7 or 12). Here is my code so far:

/*
 * Our Custom oneLine Blade Function
 *
 * Imports a blade, and minifies it into one line
 */
Blade::directive('oneLine', function($expression)
{
    return "<?php echo implode(\" \",explode(\"\n\",\$__env->make($expression, array_except(get_defined_vars(), array('__data', '__path')))->render())); ?>";
});

1 个答案:

答案 0 :(得分:3)

Just wrap everything with a for i := range(1000) { // Open connection // Perform command // Close connection } loop:

do-while

Or something to that extent. :)

See https://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html