Skip to content

[BE] ์ด๊ทผํ‘œ ๐Ÿ‘ฅ ์˜ค๋Š˜์˜ ์ง๊ฟ์€?#15

Open
rootTiket wants to merge 4 commits into
Leets-Official:mainfrom
rootTiket:rootTiket
Open

[BE] ์ด๊ทผํ‘œ ๐Ÿ‘ฅ ์˜ค๋Š˜์˜ ์ง๊ฟ์€?#15
rootTiket wants to merge 4 commits into
Leets-Official:mainfrom
rootTiket:rootTiket

Conversation

@rootTiket

@rootTiket rootTiket commented Apr 10, 2024

Copy link
Copy Markdown
Member

ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ


แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2024-04-11 แ„‹แ…ฉแ„’แ…ฎ 6 52 22

์‹คํ–‰๊ฒฐ๊ณผ


แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2024-04-11 แ„‹แ…ฉแ„’แ…ฎ 6 54 36

๊ธฐ๋Šฅ ๋ช…์„ธ์„œ


โœ… ์ž…๋ ฅ๋ฐ›์€ ์ด๋ฆ„์„ , ๊ธฐ์ค€์œผ๋กœ ์ด๋ฆ„ ๋ฆฌ์ŠคํŠธ ์ƒ์„ฑ
โœ… ์ž…๋ ฅ๋œ ์ด๋ฆ„ ์ˆ˜๋ฅผ ์ €์žฅํ•˜๋Š” ๋ฉ”์„œ๋“œ ๊ตฌํ˜„
โœ… ์ง์ˆ˜๋ฅผ ์ž…๋ ฅ ๋ฐ›๊ณ  ๋ฆฌ์ŠคํŠธ์˜ ํฌ๊ธฐ ๋ณด๋‹ค ํฌ๋ฉด ์˜ˆ์™ธ๋ฅผ ์ฒ˜๋ฆฌ
โœ… ๋‹ค์‹œ ๋ฝ‘๊ธฐ ์‹คํ–‰์‹œ y,n ์„ ์ œ์™ธํ•œ ๋ฌธ์ž๊ฐ€ ์ž…๋ ฅ ๋  ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
โœ… ์ง์„ ๋ฝ‘๊ณ  ์ฃผ์–ด์ง„ ํ˜•์‹์— ๋งž๊ฒŒ ์ถœ๋ ฅํ•˜๋Š” ๋ฉ”์„œ๋“œ ๊ตฌํ˜„

@rootTiket rootTiket self-assigned this Apr 10, 2024

@taeseokyang taeseokyang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค!!!!

public void run() {
System.out.println("๋ฉค๋ฒ„์˜ ์ด๋ฆ„์„ ์ž…๋ ฅํ•ด ์ฃผ์„ธ์š”. (, ๋กœ ๊ตฌ๋ถ„)");
Scanner sc = new Scanner(System.in);
String input = sc.nextLine();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

๋ฌด์Šจ ์ž…๋ ฅ์ธ์ง€ ๋‚˜ํƒ€๋‚ด๋Š” ๋ณ€์ˆ˜๋ช…์ด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

System.out.println("์ตœ๋Œ€ ์ง ์ˆ˜๋ฅผ ์ž…๋ ฅํ•ด ์ฃผ์„ธ์š”.");
int maxNum = Integer.parseInt(sc.nextLine());
checkDataValidity(memberList.size(), maxNum);
String flag ="true";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

๋ฌด์Šจ ํ”Œ๋ž˜๊ทธ ์ธ์ง€ ์•Œ๋ ค์ฃผ๋ฉด ์ข‹์„๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค!
๋ณ€์ˆ˜๋ช…๋งŒ ๋ณด๊ณ  ๋ฐ”๋กœ ์ดํ•ด ํ•˜๋ฉด ์ฝ”๋“œ๋ฅผ ์ฝ๊ธฐ ๋”์šฑ ํŽธํ•  ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค!

boolean ํ˜• ๋ณ€๊ฒฝํ•˜๋Š” ๊ฒƒ๋„ ์ข‹๋‹ค ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค! ๋งŒ์•ฝ ๊ทธ๋ ‡๋‹ค๋ฉด isDone์€ ์–ด๋–จ๊นŒ์š”?
ํ˜„์žฌ String ํ˜•์œผ๋กœ true, exception์„ ๋ฐ˜ํ™˜ ๋ฐ›๊ณ  ์žˆ๋Š”๋ฐ, isContinue() ํ•จ์ˆ˜์—์„œ๋Š” ๊ณ„์† ํ• ์ง€ ์•ˆํ• ์ง€ true, false ๋‘˜์ค‘ ํ•˜๋‚˜๋งŒ ๋ฐ˜ํ™˜ํ•˜๋ฉด ๋œ๋‹ค ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค!

// ๋ฌธ์ž์—ด๋กœ๋œ ๋ฉค๋ฒ„๋“ค์„ ๋ฆฌ์ŠคํŠธ๋กœ ๋ถ„๋ฆฌํ•˜๋Š” ํ•จ์ˆ˜์ž…๋‹ˆ๋‹ค.
public List<String> parseMembers(String members) {
return new ArrayList<>();
List<String> memberList = new ArrayList<>();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

return Arrays.asList(members.split(","));
์œ„์™€ ๊ฐ™์ด ์ž‘์„ฑ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค!

@ay-eonii ay-eonii left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

1์ฃผ์ฐจ ๋ฏธ์…˜ ๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค
char๋กœ ํ•œ๊ธ€์„ ํŒ๋‹จํ•œ๊ฒŒ ์ธ์ƒ๊นŠ๋„ค์š”! ๐Ÿ‘

์—ฌ์œ ๊ฐ€ ์žˆ๋‹ค๋ฉด ํด๋ž˜์Šค๊ฐ€ ์ ์ ˆํ•œ ์ฑ…์ž„์„ ๊ฐ€์ง€๋„๋ก ๋ถ„๋ฆฌํ•ด๋ด๋„ ์ข‹๊ฒ ์–ด์š”!

int maxNum = Integer.parseInt(sc.nextLine());
checkDataValidity(memberList.size(), maxNum);
String flag ="true";
while (flag.equals("true") || flag.equals("exception")) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

๋งŒ์•ฝ flag ๊ฐ€ null ์ด๋ผ๋ฉด ์–ด๋–ค ๋ฌธ์ œ๊ฐ€ ์žˆ์„๊นŒ์š”?
๊ทธ๋ฆฌ๊ณ  ์ด๋ฅผ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ์–ด๋–ป๊ฒŒ ํ•ด์•ผํ• ๊นŒ์š”?

public void checkHasNoEnglish(String members) {
try {
for (char c : members.toCharArray()) {
if (!(c >= '๊ฐ€' && c <= 'ํžฃ') && !(Character.toString(c).equals(","))) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

๋ณต์žกํ•œ ์กฐ๊ฑด๋ฌธ์€ ๋ฉ”์„œ๋“œ๋กœ ๋”ฐ๋กœ ๋นผ๋ฉด ๊ฐ€๋…์„ฑ์ด ์ฃ ์•„์ ธ์š” ๐Ÿ‘

}
} catch (Exception e) {
System.out.println(e.getMessage());
run();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

์ˆซ์ž ์‹ค์ˆ˜ํ•˜๋ฉด ์ด๋ฆ„๊นŒ์ง€ ๋‹ค์‹œ ์ž…๋ ฅ๋ฐ›๋Š” ํ•˜๋“œ์ฝ”์–ด ํ”„๋กœ๊ทธ๋žจ์ด ๋˜์—ˆ๋„ค์š”! ๐Ÿ‘

Comment on lines +84 to +92
for (List<String> line : result) {
StringBuilder sb = new StringBuilder();
sb.append("[ ");
for (String s : line) {
sb.append(s).append(" | ");
}
sb.replace(sb.length()-2,sb.length(),"]");
System.out.println(sb);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

StringJoiner์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋ฉด ํŽธํ•ด์งˆ๊ฑฐ์—์š”!

Comment on lines +100 to +109
if (q.equals("n")) {
System.out.println("์ž๋ฆฌ๋ฅผ ์ด๋™ํ•ด ์„œ๋กœ์—๊ฒŒ ์ธ์‚ฌํ•ด์ฃผ์„ธ์š”.");
return "false";
} else if (q.equals("y")) {
System.out.println("--------------------------------");
return "true";
} else {
System.out.println("[ERROR] y ํ˜น์€ n๋งŒ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.");
return "exception";
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

else ๋Š” ์—†์–ด๋„ ๋˜๊ฒ ๋„ค์š”!

public static String isContinue() {
System.out.print("๋‹ค์‹œ ๊ตฌ์„ฑํ•˜์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ? (y or n): ");
Scanner sc = new Scanner(System.in);
String q = sc.nextLine();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

q ๋Š” ๋ฌด์—‡์„ ์˜๋ฏธํ•˜๋‚˜์š”?

-๋‹ค์‹œ ๋ฝ‘๊ธฐ๋ฅผ ์œ„ํ•œ while ๋ฌธ์˜ flag ๋ณ€์ˆ˜ ํƒ€์ž…์„ Boolean์œผ๋กœ ๋ณ€๊ฒฝ
-flag ๋ณ€์ˆ˜์˜ ์ด๋ฆ„์„ isDone์œผ๋กœ ์ˆ˜์ •
-isContinue์˜ ๋ฐ˜ํ™˜๊ฐ’์„ Boolean์œผ๋กœ ์ˆ˜์ •
-for๋ฌธ ๋Œ€์‹  asList๋ฅผ ์ด์šฉํ•˜์—ฌ ๋ฉค๋ฒ„๋ฅผ ๋ถ„๋ฆฌํ•˜๋„๋ก ๋ณ€๊ฒฝ
@rootTiket rootTiket changed the title [BE] ์ด๊ทผํ‘œ ์˜ค๋Š˜์˜ ์ง๊ฟ์€? [BE] ์ด๊ทผํ‘œ ๐Ÿ‘ฅ ์˜ค๋Š˜์˜ ์ง๊ฟ์€? Apr 11, 2024

@jiixon jiixon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค~

Comment on lines +17 to +20
Boolean isDone = true;
while (isDone .equals(true)) {
printResult(generateRandomGroups(memberList,maxNum));
isDone = isContinue();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

while (isDone) { ์ด๋ ‡๊ฒŒ ๊ตฌํ˜„ํ•ด๋„ ๋˜์ง€์•Š์„๊นŒ์š”?

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.

4 participants