Made the random bool function faster.

This commit is contained in:
The Wobbler 2024-07-16 08:56:51 +02:00
parent 871fb02521
commit 95440471c4

View file

@ -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