From c719e8a5e038bc2ad238f8d980ed51237a5b7c16 Mon Sep 17 00:00:00 2001 From: Vishal K <116670999+Vishalk91-4@users.noreply.github.com> Date: Wed, 24 Jan 2024 20:03:00 +0530 Subject: [PATCH 1/3] Changed Shuffle to one argument --- Benchmark/take5/shallow/dealer.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Benchmark/take5/shallow/dealer.py b/Benchmark/take5/shallow/dealer.py index 23cbe9d..4b0edbb 100644 --- a/Benchmark/take5/shallow/dealer.py +++ b/Benchmark/take5/shallow/dealer.py @@ -1,4 +1,4 @@ -from random import randrange, shuffle, random, seed +from random import randrange, randint, shuffle, random, seed from copy import deepcopy from player import Player from typing import List, Tuple @@ -60,12 +60,11 @@ def create_deck(self, deck_size, bull_points: float = .5, order: float = .5) -> :param order: float, order of cards parametrization :return: [Card ...] """ - seed(deck_size) + random.seed(deck_size) cards = [] for i in range(deck_size): - cards.append((i + 1, randrange(min_val, max_val))) - s = (order or random()) - shuffle(cards, lambda: s) + cards.append((i + 1, random.randint(min_val, max_val))) + random.shuffle(cards) return cards def create_stacks(self) -> (List[List[Tuple[int, int]]]): From 6184631ca31b8176d39fa8d080aa91430cd01cd4 Mon Sep 17 00:00:00 2001 From: Vishal K <116670999+Vishalk91-4@users.noreply.github.com> Date: Wed, 24 Jan 2024 20:04:37 +0530 Subject: [PATCH 2/3] Changed shuffle to one argument --- Benchmark/take5/untyped/dealer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Benchmark/take5/untyped/dealer.py b/Benchmark/take5/untyped/dealer.py index 65495ad..34798e4 100644 --- a/Benchmark/take5/untyped/dealer.py +++ b/Benchmark/take5/untyped/dealer.py @@ -1,4 +1,4 @@ -from random import randrange, shuffle, random, seed +from random import randint, shuffle, random, seed from copy import deepcopy from player import Player @@ -58,14 +58,14 @@ def create_deck(self, deck_size, bull_points, order): :param order: float, order of cards parametrization :return: [Card ...] """ - seed(deck_size) + random.seed(deck_size) cards = [] for i in range(deck_size): - cards.append((i + 1, randrange(min_val, max_val))) - s = (order or random()) - shuffle(cards, lambda: s) + cards.append((i + 1, random.randint(min_val, max_val))) + random.shuffle(cards) return cards + def create_stacks(self): """ create 4 new stacks each having 1 card from the deck From f3dcdf43eb8826d4177524bbe21b77aa98273f04 Mon Sep 17 00:00:00 2001 From: Vishal K <116670999+Vishalk91-4@users.noreply.github.com> Date: Wed, 24 Jan 2024 20:05:18 +0530 Subject: [PATCH 3/3] Replaced randrange to randint --- Benchmark/take5/shallow/dealer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Benchmark/take5/shallow/dealer.py b/Benchmark/take5/shallow/dealer.py index 4b0edbb..b1b099e 100644 --- a/Benchmark/take5/shallow/dealer.py +++ b/Benchmark/take5/shallow/dealer.py @@ -1,4 +1,4 @@ -from random import randrange, randint, shuffle, random, seed +from random import randint, shuffle, random, seed from copy import deepcopy from player import Player from typing import List, Tuple