Made the random bool function faster.
This commit is contained in:
parent
871fb02521
commit
95440471c4
1 changed files with 2 additions and 2 deletions
|
@ -4,11 +4,11 @@ import pygame
|
||||||
from pygame._sdl2 import Window
|
from pygame._sdl2 import Window
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from wobbl_tools.data_file import load_dataclass_json, save_dataclass_json
|
from wobbl_tools.data_file import load_dataclass_json, save_dataclass_json
|
||||||
from random import choice
|
from random import getrandbits
|
||||||
|
|
||||||
|
|
||||||
def true_false_random():
|
def true_false_random():
|
||||||
return choice([True, False])
|
return getrandbits(1) == 0
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
Loading…
Reference in a new issue