20162328蔡文琛 实验五 数据结构综合应用

实验五:数据结构综合应用

课程:程序设计与数据结构
班级: 1623
姓名: 蔡文琛
学号:20162328
指导教师:娄嘉鹏 王志强
实验日期:12月15日
实验密级: 非密级
预习程度: 已预习
必修/选修: 必修
实验名称: 数据结构综合应用算法

实验内容:

1.分析系统架构
2.编译、运行、测试系统
3.修改系统
4.分析数据结构、排序、查找算法的应用数组

实验要求

1.没有Linux基础的同窗建议先学习《Linux基础入门(新版)》《Vim编辑器》 课程
完成实验、撰写实验报告,实验报告以博客方式发表在博客园,注意实验报告重点是 运行结果,遇到的问题(工具查找,安装,使用,程序的编辑,调试,运行等)、解决 办法(空洞的方法如“查网络”、“问同窗”、“看书”等一概得0分)以及分析(从中可 以获得什么启示,有什么收获,教训等)。报告能够参考范飞龙老师的指导
严禁抄袭,有该行为者实验成绩归零,并附加其余惩罚措施。bash

数据结构分析

此次项目咱们组从一开始就严格按照老师所讲,为咱们的项目设计了很是缜密的结构层次,保证详细到每一个细节,让用户拥有不一样的app体验。网络

周五实验总结

实验一

实验要求咱们对小组码云项目的代码克隆和运行。
数据结构

创建我的文件夹,进入码云项目,使用bash将项目的全部代码所有克隆到本身的文件夹中。
架构

使用Android Studio对克隆的代码进行编译运行。app

实验二

添加能够显示本身学号姓名的按钮,以及改变游戏视图界面。
编辑器

在布局文件中添加button,调整button的位置,改变button的名字,在主活动中添加要显示的信息。
工具

改变设定好的游戏地图数组,显示出不一样的地图。布局

查找算法的运用

//判断按键对象
    private boolean touch_blow_to_man(int touch_x, int touch_y, int manRow, int manColumn) {
        int width = (int) buttonWidth;
        int hight = (int) buttonHight;
        Rect belowRect = new Rect(2*width,getWidth()+2*hight,3*width,getWidth()+3*hight);
        return belowRect.contains(touch_x, touch_y);
    }

    private boolean touch_above_to_man(int touch_x, int touch_y, int manRow, int manColumn) {
        int width = (int) buttonWidth;
        int hight = (int) buttonHight;
        Rect aboveRect = new Rect(2*width,getWidth(),3*width,getWidth()+hight);
        return aboveRect.contains(touch_x, touch_y);
    }

    private boolean touch_left_to_man(int touch_x, int touch_y,  int manRow, int manColumn) {
        int width = (int) buttonWidth;
        int hight = (int) buttonHight;
        Rect leftRect = new Rect(width,getWidth()+hight,2*width,getWidth()+2*hight);
        return leftRect.contains(touch_x, touch_y);
    }

    private boolean touch_right_to_man(int touch_x, int touch_y, int manRow, int manColumn) {
        int width = (int) buttonWidth;
        int hight = (int) buttonHight;
        Rect rightRect = new Rect(3*width,getWidth()+hight,4*width,getWidth()+2*hight);
        return rightRect.contains(touch_x, touch_y);
    }
    private boolean touch_back_to_man(int touch_x, int touch_y, int manRow, int manColumn) {
        int width = (int) buttonWidth;
        int hight = (int) buttonHight;
        Rect rightRect = new Rect(4*width,0,5*width,hight);
        return rightRect.contains(touch_x, touch_y);
    }

以上代码首先用查找的方法肯定每一个键位的位置,也就是所谓的坐标,而后和想要实现的对象相比较,若是相等,就返回“真”,而后继续进行下一步操做。

本次实验检验了小组各个成员对于小组项目代码是否熟悉,可否自主运行并解释代码的含义。

相关文章
相关标签/搜索