• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • API Docs
    • Environments
    • Tutorials
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • Shifter »
    • Yogi »
    • YUI 2
    • YUI Doc »
    • YUI Test
    • YUI Website
    • YUI Compressor »
    • YUI Builder »
    • YUI PHP Loader
    • Grid Builder »
    • Skin Builder »
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

Context Navigation

    Build Tag: gallery-2012.07.18-13-22

    Return to Alea Pseudorandom Number Generator

    YUI({
        //Last Gallery Build of this module
        gallery: 'gallery-2013.05.02-22-59'
    }).use('gallery-alea', function(Y) {
        var random = new Y.Alea().random,
            randomInteger = function (max, min) {
                return Math.floor(min + random() * (max - min + 1));
            },
            rollD6 = function (count) {
                var sum = 0;
     
                while (count > 0) {
                    count -= 1;
                    sum += randomInteger(6, 1);
                }
     
                return sum;
            };
     
        // The result of rolling two 6-sided dice:
        alert(rollD6(2));
    });

    Build Output

    /home/y/libexec/ant/bin/ant all
    Buildfile: build.xml
         [echo] Starting Build For gallery-alea
    
    clean:
    
    init:
        [mkdir] Created dir: /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-alea/build_tmp
         [echo] Starting Build For gallery-alea
    
    -lint-server:
         [echo] Starting Build For gallery-alea
    
    -node:
         [echo] For faster builds, install Node.js.
    
    -concatdebug:
         [copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-alea/build_tmp/ant
       [delete] Deleting directory /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-alea/build_tmp/ant
    
    -registerdebug:
         [copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-alea/build_tmp
    
    -prependdebug:
    
    -appenddebug:
    
    builddebug:
    
    -createcore:
         [copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-alea/build_tmp
    
    -loggerregex:
    
    buildcore:
    
    -rollupjs:
    
    -concatskins:
    
    -buildskins:
    
    -rollupcss:
    
    buildskins:
    
    -buildlangs:
    
    -rolluplangs:
    
    buildlangs:
    
    build:
    
    minify:
    [yuicompressor] Compressing /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-alea/build_tmp/gallery-alea.js
    [yuicompressor] 
    [yuicompressor] [WARNING] Invalid hint syntax: use strict
    [yuicompressor] ){!
    [yuicompressor]  * based on Alea.js and Mash.js. http://baagoe.com/en/RandomMusings/javascript/
    [yuicompressor]  * Copyright (C) 2010 by Johannes Baagøe 
    [yuicompressor]  *
    [yuicompressor]  * Permission is hereby granted, free of charge, to any person obtaining a copy
    [yuicompressor]  * of this software and associated documentation files (the "Software"), to deal
    [yuicompressor]  * in the Software without restriction, including without limitation the rights
    [yuicompressor]  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    [yuicompressor]  * copies of the Software, and to permit persons to whom the Software is
    [yuicompressor]  * furnished to do so, subject to the following conditions:
    [yuicompressor]  *
    [yuicompressor]  * The above copyright notice and this permission notice shall be included in
    [yuicompressor]  * all copies or substantial portions of the Software.
    [yuicompressor]  *
    [yuicompressor]  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    [yuicompressor]  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    [yuicompressor]  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    [yuicompressor]  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    [yuicompressor]  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    [yuicompressor]  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    [yuicompressor]  * THE SOFTWARE.
    [yuicompressor]  (function(Y){ ---> "use strict" <--- ;var _Array=Y.Array,_each=
    [yuicompressor] Compressed to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-alea/build_tmp/gallery-alea-min.js
    
    lint:
         [echo] Using Rhino. Install nodejs to improve jslint speed, or skip with -Dlint.skip=true
         [java] Running JSLint on : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-alea/build_tmp/gallery-alea.js
         [java] - OK
    
    local:
    
    deploybuild:
         [copy] Copying 3 files to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-alea
    
    deployassets:
    
    deployskins:
    
    deploylang:
    
    deploydocs:
    
    deploy:
    
    all:
    
    BUILD SUCCESSFUL
    Total time: 2 seconds

    © 2006-2013 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info