網格
12 個節點
本頁內容 12
統計格子
函數How many cells hold a value.
統計格子(網格: Value Grid, 值: 整數) -> 整數
int CountCells(ValueGrid grid, int value)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 網格 | Value Grid | — | The grid. |
| 值 | 整數 | — | The value. |
返回
| 數量 | 整數 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 網格
- 所屬包
- 罪案引擎
查詢格子
函數The cells holding a value, row by row from the top.
查詢格子 -> (數量: 整數, 列: 整數陣列, 行: 整數陣列)
網格: Value Grid
值: 整數int FindCells(
ValueGrid grid,
int value,
out int[] xs,
out int[] ys)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 網格 | Value Grid | — | The grid. |
| 值 | 整數 | — | The value. |
返回
| 數量 | 整數 |
| 列 | 整數陣列 |
| 行 | 整數陣列 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 網格
- 所屬包
- 罪案引擎
查詢網格路徑
函數The cheapest path between two cells, moving four ways through cells holding the open value; the two ends may hold anything. Steps and turns each cost what they are given, a turn limit can be set, and a margin lets the path run round the outside of the grid. The corners are the start, each turn and the end - enough to draw the path as straight lines - and may lie in the margin.
查詢網格路徑 -> (找到: 真否, 拐點列: 整數陣列, 拐點行: 整數陣列, 拐彎數: 整數)
網格: Value Grid
起點列: 整數
起點行: 整數
終點列: 整數
終點行: 整數
可通行值: 整數
外圍格數: 整數
每步代價: 整數
拐彎代價: 整數
最多拐彎數: 整數bool FindPath(
ValueGrid grid,
int fromX,
int fromY,
int toX,
int toY,
out int[] xs,
out int[] ys,
out int turns,
int open = 0,
int margin = 0,
int stepCost = 1,
int turnCost = 0,
int maxTurns = -1)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 網格 | Value Grid | — | The grid. |
| 起點列 | 整數 | — | Start column. |
| 起點行 | 整數 | — | Start row. |
| 終點列 | 整數 | — | End column. |
| 終點行 | 整數 | — | End row. |
| 可通行值 | 整數 | 0 | The value of a cell the path may cross. |
| 外圍格數 | 整數 | 0 | How many cells beyond each edge the path may use. |
| 每步代價 | 整數 | 1 | What each step costs. |
| 拐彎代價 | 整數 | 0 | What each turn costs. |
| 最多拐彎數 | 整數 | -1 | The most turns allowed; -1 for no limit. |
返回
| 找到 | 真否 |
| 拐點列 | 整數陣列 |
| 拐點行 | 整數陣列 |
| 拐彎數 | 整數 |
備註
With the defaults it is the shortest walk. A tile-matching link - straight runs through empty cells with at most two turns, round the outside if need be - is open 0, margin 1, step cost 0, turn cost 1, max turns 2.
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 網格
- 所屬包
- 罪案引擎
由數值生成網格
函數A grid holding the given values, row by row from the top.
由數值生成網格 -> Value Grid
寬度: 整數
高度: 整數
數值: 整數陣列ValueGrid FromValues(int width, int height, int[] values)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 寬度 | 整數 | — | Cells across. |
| 高度 | 整數 | — | Cells down. |
| 數值 | 整數陣列 | — | Width × height of them. |
返回
| 網格 | Value Grid |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 網格
- 所屬包
- 罪案引擎
讀取格子
函數What a cell holds; the grid's outside value for a cell beyond it.
讀取格子(網格: Value Grid, 列: 整數, 行: 整數) -> 整數
int GetCell(ValueGrid grid, int x, int y)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 網格 | Value Grid | — | The grid. |
| 列 | 整數 | — | Column. |
| 行 | 整數 | — | Row. |
返回
| 值 | 整數 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 網格
- 所屬包
- 罪案引擎
建立網格
函數A grid with every cell holding one value.
建立網格(寬度: 整數, 高度: 整數, 填充值: 整數) -> Value Grid
ValueGrid Make(int width = 8, int height = 8, int fill = 0)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 寬度 | 整數 | 8 | Cells across. |
| 高度 | 整數 | 8 | Cells down. |
| 填充值 | 整數 | 0 | What every cell holds. |
返回
| 網格 | Value Grid |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 網格
- 所屬包
- 罪案引擎
相鄰格子配對
函數As many pairs of side-by-side cells holding a value as can be made with no cell used twice: a tiling by dominoes. The nth pair is (first xs, first ys) and (second xs, second ys) at n.
相鄰格子配對 -> (對數: 整數, 第一格列: 整數陣列, 第一格行: 整數陣列, 第二格列: 整數陣列, 第二格行: 整數陣列)
網格: Value Grid
值: 整數
種子: 整數int PairNeighbours(
ValueGrid grid,
int value,
out int[] firstXs,
out int[] firstYs,
out int[] secondXs,
out int[] secondYs,
int seed = 0)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 網格 | Value Grid | — | The grid. |
| 值 | 整數 | — | Which cells to pair. |
| 種子 | 整數 | 0 | Different seeds give different tilings; 0 gives the same one every time. |
返回
| 對數 | 整數 |
| 第一格列 | 整數陣列 |
| 第一格行 | 整數陣列 |
| 第二格列 | 整數陣列 |
| 第二格行 | 整數陣列 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 網格
- 所屬包
- 罪案引擎
網格區域
函數The cells holding the same value as a starting cell and joined to it four ways: what a paint bucket fills.
網格區域 -> (數量: 整數, 列: 整數陣列, 行: 整數陣列)
網格: Value Grid
起點列: 整數
起點行: 整數int Region(
ValueGrid grid,
int x,
int y,
out int[] xs,
out int[] ys)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 網格 | Value Grid | — | The grid. |
| 起點列 | 整數 | — | Start column. |
| 起點行 | 整數 | — | Start row. |
返回
| 數量 | 整數 |
| 列 | 整數陣列 |
| 行 | 整數陣列 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 網格
- 所屬包
- 罪案引擎
設定格子
函數The grid with one cell holding a new value.
設定格子 -> Value Grid
網格: Value Grid
列: 整數
行: 整數
值: 整數ValueGrid SetCell(ValueGrid grid, int x, int y, int value)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 網格 | Value Grid | — | The grid. |
| 列 | 整數 | — | Column. |
| 行 | 整數 | — | Row. |
| 值 | 整數 | — | What it holds now. |
返回
| 網格 | Value Grid |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 網格
- 所屬包
- 罪案引擎
設定多個格子
函數The grid with several cells set at once, the nth cell to the nth value - or every cell to the one value when only one is given.
設定多個格子 -> Value Grid
網格: Value Grid
列: 整數陣列
行: 整數陣列
值: 整數陣列ValueGrid SetCells(
ValueGrid grid,
int[] xs,
int[] ys,
int[] values)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 網格 | Value Grid | — | The grid. |
| 列 | 整數陣列 | — | Columns. |
| 行 | 整數陣列 | — | Rows, as many as columns. |
| 值 | 整數陣列 | — | One value for all, or one for each cell. |
返回
| 網格 | Value Grid |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 網格
- 所屬包
- 罪案引擎
打亂網格格子
函數The grid with what its cells hold shuffled among them, leaving every cell that holds the kept value where it is.
打亂網格格子 -> Value Grid
網格: Value Grid
保留值: 整數
種子: 整數ValueGrid ShuffleCells(
ValueGrid grid,
int keep = 0,
int seed = 1)參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 網格 | Value Grid | — | The grid. |
| 保留值 | 整數 | 0 | The value that stays put; 0 keeps the empty cells empty. |
| 種子 | 整數 | 1 | The same seed shuffles the same way. |
返回
| 網格 | Value Grid |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 網格
- 所屬包
- 罪案引擎
網格數值
函數Every cell's value, row by row from the top.
網格數值(網格: Value Grid) -> 整數陣列
int[] Values(ValueGrid grid)
參數
| 名稱 | 型別 | 預設值 | 說明 |
|---|---|---|---|
| 網格 | Value Grid | — | The grid. |
返回
| 數值 | 整數陣列 |
- 所屬發行版
- 元編程(教育版)元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 網格
- 所屬包
- 罪案引擎