Lists ko KR - Reetus/ClassicAssist GitHub Wiki

ํด๋ž˜์‹์–ด์‹œ์ŠคํŠธ ๋งคํฌ๋กœ ๋ช…๋ น์–ด

์ƒ์„ฑ๋œ 2024-12-15 ์˜ค์ „ 3:30:41
๋ฒ„์ „: 4.425.22+b9a337759d26b9d39ae8ccaac75a36c4255be94a
Translated by Mark Hunt & Andy H.

๋ชฉ๋ก

ClearList

๋ฉ”์„œ๋“œ ์‹œ๊ทธ๋‹ˆ์ฒ˜:

Void ClearList(System.String)

ํŒŒ๋ผ๋ฏธํ„ฐ

  • listname: ๋ฆฌ์ŠคํŠธ ์ด๋ฆ„.

์„ค๋ช…:

๋ชฉ๋ก์—์„œ ์ด๋ฆ„์„ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

ClearList("list")  

CreateList

๋ฉ”์„œ๋“œ ์‹œ๊ทธ๋‹ˆ์ฒ˜:

Void CreateList(System.String)

ํŒŒ๋ผ๋ฏธํ„ฐ

  • listname: ๋ฆฌ์ŠคํŠธ ์ด๋ฆ„.

์„ค๋ช…:

์ด๋ฆ„์œผ๋กœ ๋ชฉ๋ก์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค. ๋ชฉ๋ก์ด ์ด๋ฏธ ์žˆ์œผ๋ฉด ๊ฒน์ณ ์”๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

CreateList("list")  

GetList

๋ฉ”์„œ๋“œ ์‹œ๊ทธ๋‹ˆ์ฒ˜:

System.Object[] GetList(System.String)

ํŒŒ๋ผ๋ฏธํ„ฐ

  • listname: ๋ฆฌ์ŠคํŠธ ์ด๋ฆ„.

์„ค๋ช…:

๋ฃจํ”„ ๋“ฑ๊ณผ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ๋ชฉ๋ก์—์žˆ๋Š” ๋ชจ๋“  ํ•ญ๋ชฉ์˜ ๋ฐฐ์—ด์„ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

GetList("list")  

InList

๋ฉ”์„œ๋“œ ์‹œ๊ทธ๋‹ˆ์ฒ˜:

Boolean InList(System.String, System.Object)

ํŒŒ๋ผ๋ฏธํ„ฐ

  • listname: ๋ฆฌ์ŠคํŠธ ์ด๋ฆ„.
  • value: ์ •์ˆ˜ ๊ฐ’ - ์‚ฌ์šฉ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ์„ค๋ช…์„ ๋ณด์„ธ์š”.

์„ค๋ช…:

์ฃผ์–ด์ง„ ์š”์†Œ๊ฐ€ ๋ชฉ๋ก์— ํฌํ•จ๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

if InList("shmoo", 1):  

List

๋ฉ”์„œ๋“œ ์‹œ๊ทธ๋‹ˆ์ฒ˜:

Int32 List(System.String)

ํŒŒ๋ผ๋ฏธํ„ฐ

  • listname: ๋ฆฌ์ŠคํŠธ ์ด๋ฆ„.

์„ค๋ช…:

๋ฆฌ์ŠคํŠธ ๋‚ด์˜ ์—”ํŠธ๋ฆฌ ์ˆ˜๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

if List("list") < 5:  

ListExists

๋ฉ”์„œ๋“œ ์‹œ๊ทธ๋‹ˆ์ฒ˜:

Boolean ListExists(System.String)

ํŒŒ๋ผ๋ฏธํ„ฐ

  • listname: ๋ฆฌ์ŠคํŠธ ์ด๋ฆ„.

์„ค๋ช…:

๋ฆฌ์ŠคํŠธ๊ฐ€ ์กด์žฌํ•˜๋ฉด true, ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด false.

์˜ˆ์‹œ:

if ListExists("list"):  

PopList

๋ฉ”์„œ๋“œ ์‹œ๊ทธ๋‹ˆ์ฒ˜:

Int32 PopList(System.String, System.Object)

ํŒŒ๋ผ๋ฏธํ„ฐ

  • listname: ๋ฆฌ์ŠคํŠธ ์ด๋ฆ„.
  • elementvalue: ๋งค๊ฐœ๋ณ€์ˆ˜_์„ค๋ช…_์š”์†Œ๊ฐ’ ์ „๋ฉด๊ณผ ํ›„๋ฉด. (์˜ต์…˜)

์„ค๋ช…:

๋ชฉ๋ก์—์„œ ์š”์†Œ(elements)๋ฅผ ์ œ๊ฑฐํ•˜๊ณ  ์ œ๊ฑฐ๋œ ์š”์†Œ(elements) ์ˆ˜๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค

์˜ˆ์‹œ:

CreateList("hippies")
PushList("hippies", 1)
PushList("hippies", 2)
PushList("hippies", 3)

PopList("hippies", "front") # Removes 1
PopList("hippies", "back") # Removes 3
PopList("hippies", "2") # Removes any 2's that exist in the list


for x in GetList("hippies"):
 print x # Never reached because list is empty
  

PushList

๋ฉ”์„œ๋“œ ์‹œ๊ทธ๋‹ˆ์ฒ˜:

Void PushList(System.String, System.Object)

ํŒŒ๋ผ๋ฏธํ„ฐ

  • listname: ๋ฆฌ์ŠคํŠธ ์ด๋ฆ„.
  • value: ์ •์ˆ˜ ๊ฐ’ - ์‚ฌ์šฉ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ์„ค๋ช…์„ ๋ณด์„ธ์š”.

์„ค๋ช…:

๋ชฉ๋ก์˜ ๋์„ ๋ณด์—ฌ์ฃผ๊ณ , ๋ชฉ๋ก์ด ์—†์œผ๋ฉด ๋ชฉ๋ก์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

PushList("list", 1)  

RemoveList

๋ฉ”์„œ๋“œ ์‹œ๊ทธ๋‹ˆ์ฒ˜:

Void RemoveList(System.String)

ํŒŒ๋ผ๋ฏธํ„ฐ

  • listname: ๋ฆฌ์ŠคํŠธ ์ด๋ฆ„.

์„ค๋ช…:

์ฃผ์–ด์ง„ ์ด๋ฆ„์˜ ๋ชฉ๋ก์„ ์ œ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

RemoveList("list")