Interface Game

Generator to generate game related entries.

interface Game {
    dice(numdice: number, sides: number[]): number[];
    gamertag(): string;
}

Methods

Methods

  • Small, cube-shaped objects used in games of chance for random outcomes.

    Parameters

    • numdice: number

      Number of Dice

    • sides: number[]

      Number of Sides

    Returns number[]

    a random dice

    import { Faker } from "k6/x/faker"

    let faker = new Faker(11)

    export default function () {
    console.log(faker.game.dice(1,[5,4,13]))
    }

    Output (formatted as JSON value)

    [5]
    
  • User-selected online username or alias used for identification in games.

    Returns string

    a random gamertag

    import { Faker } from "k6/x/faker"

    let faker = new Faker(11)

    export default function () {
    console.log(faker.game.gamertag())
    }

    Output (formatted as JSON value)

    "BraveArmadillo"