Skip to content

Instantly share code, notes, and snippets.

@aeg
Created November 14, 2012 16:42
Show Gist options
  • Save aeg/4073212 to your computer and use it in GitHub Desktop.
Save aeg/4073212 to your computer and use it in GitHub Desktop.
リストをリストの繰り返しで設定する
// Case #1
// リストを任意の値で埋める
def list = [255] * 5
assert list == [255, 255, 255, 255, 255 ]
// Case #2
// リストをリストの繰り返しで設定する
def list2 = [1, 2, 3] * 3
assert list2 == [1, 2, 3, 1, 2, 3, 1, 2, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment