Difference between revisions of "Basic Pascal Tutorial/Chapter 5/Multidimensional arrays/zh CN"
From Free Pascal wiki
Jump to navigationJump to searchm (Kai Burghardt moved page Multidimensional arrays/zh CN to Basic Pascal Tutorial/Chapter 5/Multidimensional arrays/zh CN: tidy up main name space: create subpage hierarchy for basic Pascal tutorial...) |
(bypass redirects [cf. discussion]) |
||
Line 35: | Line 35: | ||
{|style=color-backgroud="white" cellspacing="20" | {|style=color-backgroud="white" cellspacing="20" | ||
− | |[[1- | + | |[[Basic Pascal Tutorial/Chapter 5/1-dimensional arrays/zh_CN|上一页]] |
|[[Contents/zh_CN|目录]] | |[[Contents/zh_CN|目录]] | ||
− | |[[Records/zh_CN|下一页]] | + | |[[Basic Pascal Tutorial/Chapter 5/Records/zh_CN|下一页]] |
|} | |} |
Revision as of 02:17, 6 August 2022
│
български (bg) │
English (en) │
français (fr) │
日本語 (ja) │
中文(中国大陆) (zh_CN) │
5D - 多维数组 (原作者: Tao Yue, 状态: 未更改)
你可以定义多维数组:
type
datatype = array [enum_type1, enum_type2] of datatype;
下标间用逗号分隔:
a [5, 3]
二维数组可用于棋类游戏 像井字棋会有下面这些类型:
type
StatusType = (X, O, Blank);
BoardType = array[1..3,1..3] of StatusType;
var
Board : BoardType;
用于初始化:
for count1 := 1 to 3 do
for count2 := 1 to 3 do
Board[count1, count2] := Blank;
当然,你也可以使用三维或更多维的数组。
上一页 | 目录 | 下一页 |