Skip to content

Instantly share code, notes, and snippets.

@davebrny
Last active November 13, 2017 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davebrny/564328c8cfd9f85987ed9d4d0578d423 to your computer and use it in GitHub Desktop.
Save davebrny/564328c8cfd9f85987ed9d4d0578d423 to your computer and use it in GitHub Desktop.
(autohotkey) - the default random command but without returning the same number twice in a row
randomer(min="", max="") {
static last_random
loop,
random, this_random, % min, % max
until (this_random != last_random)
last_random := this_random
return this_random
}
/*
[script info]
description = the default random command but without returning the same number twice in a row
source = https://gist.github.com/davebrny/564328c8cfd9f85987ed9d4d0578d423
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment