GTX0 AnnouncementsFeedbackHelp | SandboxNewest Posts | Replies | Hottest
NIFE UpdatesRoadmapRequests | HelpDiscuss Game Worlds


Better ~(flip)~ and ~(draw)~ syntax
Posted: Posted September 29th by Xhin

~(flip)~

You can flip multiple coins..

~(flip 5)~


will flip 5 times.

You can also set what "heads" and "tails" will be:

~(flip 1 Snakes Goats)~


will either display snakes or goats instead of heads or tails.

There's a 1:6000 chance that the coin will land on its edge like a real coin. You can set this to something else:

~(flip 1 Heads Tails 10)~


will flip a normal coin once with a 1:10 chance of it landing on its edge.

~(draw)~

  • Cards look a lot better (see the bottom of this post, where I pull 5 cards).

    ~(draw)~


    This will draw a card from a standard 52-card deck.

    ~(draw 5)~


    You can draw more than one card a time, much like flip and roll.

    ~(draw 5 2/3/4/5/6/7/8/9/10/J/Q/K/A)~


    The next argument you can specify the different ranks. The default is above, but you can make them look more verbose, add ranks, or whatever.

    ~(draw 5 2/3/4/5/6/7/8/9/10/J/Q/K/A x)~


    If you replace the "x" here with something, for example "of" -- then you'll get that word in between the rank and the suit. Having an x there sticks them together (which is the default)

    ~(draw 5 2/3/4/5/6/7/8/9/10/J/Q/K/A x ♠:000/♣:000/♥:f00/♦:f00)~


    In the next argument you can specify your suits and their hex-color to appear. I'm using html codes here for suits because GTX0 is weird about unicode sometimes.


    ~(draw 5 2/3/4/5/6/7/8/9/10/J/Q/K/A x ♠:000/♣:000/♥:f00/♦:f00 000:fff:000)~


    Lastly, you can specify the colors used for the cards themselves.. the first color is the rank color, the second is the card background color, and the last is the card border color. This gives you some more options. Want blue cards? You can do it.

    On this post I'm doing this:

    ~(draw 5)~




    Xhin drew 5 cards...KK525

  • settingsOptions
    There are 6 Replies

    Here's a weirder example.. blue cards and yellow or white suits, only numbers for ranks as well:

    ~(draw 10 1/2/3/4/5/6/7/8/9/0 x ✠:fc0/✠:fff/✶:fc0/✶:fff fff:007:000)~






    Xhin drew 10 cards...4459864271

    Edited September 29th by Xhin
    Xhin
    Fractal icious

    Incidentally removing duplicates is a bit harder to do, so there'll be a separate feature for that.

    Posted September 29th by Xhin
    Xhin
    Fractal icious




    Moonray flipped a coin in the air 100 times... Heads! Heads! Heads! Heads! Heads! Tails! Heads! Heads! Tails! Tails! Tails! Tails! Heads! Tails! Tails! Tails! Heads! Heads! Tails! Heads! Heads! Tails! Tails! Tails! Heads! Heads! Heads! Heads! Tails! Heads! Heads! Heads! Tails! Heads! Heads! Tails! Tails! Tails! Heads! Tails! Heads! Heads! Heads! Heads! Heads! Heads! Heads! Tails! Tails! Tails! Heads! Heads! Tails! Heads! Tails! Tails! Tails! Tails! Heads! Heads! Tails! Heads! Tails! Tails! Tails! Heads! Heads! Tails! Heads! Tails! Tails! Tails! Tails! Tails! Tails! Heads! Heads! Heads! Tails! Tails! Tails! Heads! Heads! Tails! Tails! Heads! Heads! Tails! Heads! Heads! Tails! Heads! Tails! Heads! Heads! Heads! Tails! Tails! Tails! Heads!

    Posted September 30th by Moonray
    Moonray
     

    *bans moonray*

    *then steals the whole dollar he just flipped*

    Posted September 30th by Xhin
    Xhin
    Fractal icious

    Incidentally removing duplicates is a bit harder to do, so there'll be a separate feature for that.

    Generate an array based on total items, select multiple random indexes, get indexed selections. That's how I did it for a quiz game. The arrays are always generated at the game's start because I couldn't be bothered to preset the arrays myself!

    Posted October 3rd by mariomguy

    I meant it doesn't fit well into the schema I have set up for these features. Having it separate will let me do something cool like like persistent decks that multiple users can pull cards from.

    Posted October 7th by Xhin
    Xhin
    Fractal icious
    Reply to: Better ~(flip)~ and ~(draw)~ syntax
    Enter your message here

    Site Rules | Complaints Process | Register Complaint Facebook Page
    GTX0 © 2009-2017 Xhin GameTalk © 1999-2008 lives on