Talk:More Java keyword flashcards

From Wikiversity
Jump to navigation Jump to search

Random Number Generator[edit source]

I replaced the {{#expr:({{#time:s}}/60*53 round 0)}} random number generator with {{#expr:({{#time:U}} mod 53) + 1}}. The original expression would generate 0 between 0 and 0.49 seconds each minute. There is no switch entry 0, causing the switch to fail. While this can be corrected by adding 0.5 to the original expression, using mod is a cleaner syntax and faster calculation. Dave Braunschweig (talk) 15:59, 27 November 2012 (UTC)