Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend/shuffle #135 #142

Merged
merged 5 commits into from
Feb 22, 2024
Merged

Backend/shuffle #135 #142

merged 5 commits into from
Feb 22, 2024

Conversation

aprilywy
Copy link
Collaborator

@aprilywy aprilywy commented Dec 5, 2023

No description provided.

@aprilywy aprilywy changed the title Backend/shuffle#135 Backend/shuffle #135 Dec 5, 2023
import java.util.Arrays;
import java.util.Random;

public class shuffle {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要可以支援不同類型的洗牌

import java.util.Random;

public class shuffle {
static void shuffle(int array[], int a) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

通常都是寫 int[] array,但這邊用 List 好了, 然後 a 是什麼XD 命名要注意

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哈 我的意思是放 List XDD,可以支援不同類型

System.out.println(Arrays.toString(array));
}

public static void main(String[] args) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

測試完 這些可以拿掉

array[j] = temp;
}

System.out.println(Arrays.toString(array));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這個也可以拿掉

import java.util.Arrays;
import java.util.Random;

public class shuffle {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class 叫 CitadelsUtils 好了

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這要放在 domain 下?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

放在 domain 可能比較好

Copy link
Collaborator

@snowmancc snowmancc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

import java.util.List;
import java.util.Random;

public class CitadelsUtils<T> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這裡不需要泛型

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這個類別要移動到 domain 那一個 package

Copy link
Collaborator

@snowmancc snowmancc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


T temp = cards.get(i);
cards.set(i, cards.get(j));
cards.set(j,temp);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要排版一下喔~

Copy link
Collaborator

@timt1028 timt1028 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@snowmancc snowmancc merged commit 0fc5431 into main Feb 22, 2024
1 check passed
@snowmancc snowmancc deleted the backend/shuffle branch February 22, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants