zoukankan      html  css  js  c++  java
  • 20162328蔡文琛 实验五 数据结构综合应用

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

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

    实验内容:

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

    实验要求

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

    数据结构分析

    这次项目我们组从一开始就严格按照老师所讲,为我们的项目设计了非常缜密的结构层次,保证详细到每个细节,让用户拥有不同的app体验。

    周五实验总结

    实验一

    实验要求我们对小组码云项目的代码克隆和运行。

    建立个人文件夹,进入码云项目,使用bash将项目的所有代码全部克隆到自己的文件夹中。

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

    实验二

    添加可以显示自己学号姓名的按钮,以及改变游戏视图界面。

    在布局文件中添加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);
        }
    

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

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

  • 相关阅读:
    Redis系列八 使用Jedis
    Redis系列七 主从复制(Master/Slave)
    Redis系列六 Redis事务
    Redis系列五 Redis持久化
    Android7.0 应用内升级
    Redis系列四 Redis常见配置
    06方法
    python协程--yield和yield from
    Python2 生成器 简介
    使用virtualenv使得Python2和Python3并存
  • 原文地址:https://www.cnblogs.com/Cai77/p/8053776.html
Copyright © 2011-2022 走看看