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);
    }

以上代碼首先用查找的方法肯定每一個鍵位的位置,也就是所謂的座標,而後和想要實現的對象相比較,若是相等,就返回「真」,而後繼續進行下一步操做。

本次實驗檢驗了小組各個成員對於小組項目代碼是否熟悉,可否自主運行並解釋代碼的含義。

相關文章
相關標籤/搜索