首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何为15个单词生成10 x 10矩阵

如何为15个单词生成10 x 10矩阵
EN

Stack Overflow用户
提问于 2011-11-17 17:16:41
回答 1查看 114关注 0票数 0

我正在做单词搜索益智游戏..我想生成10 * 10矩阵形式的大约15个单词。每个平方都是UIButton。在每个按钮上都会有单词的字符。

单词应该垂直排列,水平排列,交叉排列。

如何生成这个特定的矩阵?

任何人分享我的想法或代码等。

谢谢,凯尤尔·普拉贾帕蒂

EN

回答 1

Stack Overflow用户

发布于 2011-11-17 17:59:05

代码语言:javascript
运行
复制
Rather than button use uiimageview, it will be easy as u can implement the sliding effect as well.
U need to implement different classes as Matrix, Plate, Coordinate, BoardManager. Now you have implement the logic arround this class. 
.h matrix class 
int row; int column; NSMutableArray *matrix;

.h plate class
Coordinate *currentCordinate; //center coordinate of the plate.
int presentRow; int presentCol;

.h BoardManager
NSInteger boardMatrixRow;  NSInteger boardMatrixColumn;

.h Coordinate
CGFloat x; CGFloat y;

Now implement the methods and apply your logic of inserting the object into matrix array,assign the coordinates to the plates/image, tagging the image.

As such no tutorial encountered.
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8164668

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档