javascript課程設計報告
❶ 課程設計報告怎麼寫
歡迎看一下我的計算器, 有程序界面, 你可以參考一下,添加運算功能。 http://hi..com/jack%5Fican/blog/item/f3ab762acc95133a5243c1a2.html 說明:1.共有4個文本框其,其中三個是填入或輸出數據的(名稱分別是:txta txtb txtc),剩下的那個是符號(txtd)2.共7個按鈕,4個是符號按鈕,一個計算,一個清零.這是我弄的程序」袖珍計算器」代碼也是自己編寫的,代碼如下:通用聲明Dim j As Integer '定義j為整型 Private Sub Text1_Change()End SubPrivate Sub Command1_Click() txtfuhao.Text = "+" '將」+」顯示到文本框txtfuhao.Text中 End SubPrivate Sub Command2_Click() txtfuhao.Text = "-" ''將」-」顯示到文本框txtfuhao.Text中 End SubPrivate Sub Command3_Click() txtfuhao.Text = "×" '將」×」顯示到文本框txtfuhao.Text中 End SubPrivate Sub Command4_Click() txtfuhao.Text = "÷" 將」÷」'顯示到文本框txtfuhao.Text中 End Sub Private Sub Command5_Click() Dim a, b, c As Integer a = Val(txta.Text) '將txta.Text里的內容轉化為數值型,然後再賦給a b = Val(txtb.Text) '將txtb.Text里的內容轉化為數值型,然後再賦給b If txtfuhao.Text = "+" Then '運算過程 c = a + b '運算過程 ElseIf txtfuhao.Text = "-" Then '運算過程 c = a - b '運算過程 ElseIf txtfuhao.Text = "÷" Then '運算過程 c = a / b '運算過程 ElseIf txtfuhao.Text = "×" Then '運算過程 c = a * b '運算過程 Else j = MsgBox("您輸入的符號不正確", vbOKOnly, "錯誤信息") End If txtc.Text = c '將運算結果c輸出到文本框txtc中 End SubPrivate Sub Command6_Click() txta.Text = "" '將空字元輸入到文本框內(刷新) txtb.Text = "" '將空字元輸入到文本框內(刷新) txtc.Text = "" '將空字元輸入到文本框內(刷新) txtfuhao.Text = "" '將空字元輸入到文本框內(刷新) End SubPrivate Sub Command7_Click() End '結束程序 End SubPrivate Sub Form_Load()End Sub
❷ javascript課程設計怎麼做
先知道做什麼,才能思考怎樣做
❸ 課程設計報告要寫哪幾步,各有什麼要求
對於正文部分內容要求必須具備如下內容:
1) 目的
此次課程設計的目的。
2) 需求分析
以無二義性的陳述說明程序設計的任務,程序要做什麼?明確規定:
①輸入的形式和輸入值的范圍;
②輸出的形式;
③程序所能達到的功能;
3) 概要設計
說明本程序中用到的所有數據類型的定義及含義、各程序模塊的功能要求以及各模塊之間的層次(調用)關系。
4) 詳細設計
實現概要設計中定義的所有數據類型,對每個操作需寫出偽碼演算法;對主程序和其他模塊也都要寫出偽碼演算法;
最終實現的源程序要按照良好風格的程序書寫規則來編寫,要求結構清晰,重點函數、重點變數以及重點功能部分要加上清晰的程序注釋。
5) 調試分析
每個模塊設計和調試時存在問題的思考(問題是哪些?問題如何解決?)。
進行時間和空間復雜度分析,演算法的改進設想。
6) 測試結果
列出完備的測試計劃及其結果,包括輸入和輸出,這里的測試數據應該完整和嚴格。
7) 用戶使用說明
說明如何使用最終發布的程序,詳細列出每一步的操作步驟。
8) 課設總結
課程設計過程的收獲、遇到問題、遇到問題解決問題過程的思考、程序調試能力的思考、經驗和體會以及對設計與實現的回顧討論和分析;在課程設計過程中對課程的認識等內容。
❹ HTML 課程設計報告
設計2:企業內部Web站點構建及維護; 設計3:企業內部的DNS伺服器構建。 ......可以, 要就找我 ...我有網路設備配置與調試課程設計報告書 ...
❺ JavaScript課程設計
你這是要請人幫你寫報告啊
❻ 課程設計:使用JavaScript製作一個網頁上的貪吃蛇游戲
<html>
<head>
<title>貪吃蛇 Snake v2.4</title>
<style>
body{
font-size:9pt;
}
table{
border-collapse: collapse;
border:solid #333 1px;
}
td{
height: 10px;
width: 10px;
font-size: 0px;
}
.filled{
background-color:blue;
}
</style>
</head>
<script>
function $(id){return document.getElementById(id);}
/**************************************************************
* javascript貪吃蛇 v2.4 <br />
* author: sunxing007 05/14/2009<br />
* 轉載請註明來自http://blog.csdn.net/sunxing007 謝謝!<br />
* v2.4修正了蛇身顏色可以隨著蛇前進而移動
**************************************************************/
//貪吃蛇類
var Snake = {
tbl: null,
/**
* body: 蛇身,數組放蛇的每一節,
* 數據結構{x:x0, y:y0, color:color0},
* x,y表示坐標,color表示顏色
**/
body: [],
//當前移動的方向,取值0,1,2,3, 分別表示向上,右,下,左, 按鍵盤方向鍵可以改變它
direction: 0,
//定時器
timer: null,
//速度
speed: 250,
//是否已經暫停
paused: true,
//行數
rowCount: 30,
//列數
colCount: 30,
//初始化
init: function(){
var colors = ['red','orange','yellow','green','blue','purple','#ccc'];
this.tbl = $("main");
var x = 0;
var y = 0;
var colorIndex = 0;
//產生初始移動方向
this.direction = Math.floor(Math.random()*4);
//構造table
for(var row=0;row<this.rowCount;row++){
var tr=this.tbl.insertRow(-1);
for(var col=0;col<this.colCount;col++) {
var td=tr.insertCell(-1);
}
}
//產生20個鬆散節點
for(var i=0; i<10; i++){
x = Math.floor(Math.random()*this.colCount);
y = Math.floor(Math.random()*this.rowCount);
colorIndex = Math.floor(Math.random()*7);
if(!this.isCellFilled(x,y)){
this.tbl.rows[y].cells[x].style.backgroundColor = colors[colorIndex];
}
}
//產生蛇頭
while(true){
x = Math.floor(Math.random()*this.colCount);
y = Math.floor(Math.random()*this.rowCount);
if(!this.isCellFilled(x,y)){
this.tbl.rows[y].cells[x].style.backgroundColor = "black";
this.body.push({x:x,y:y,color:'black'});
break;
}
}
this.paused = true;
//添加鍵盤事件
document.onkeydown= function(e){
if (!e)e=window.event;
switch(e.keyCode | e.which | e.charCode){
case 13: {
if(Snake.paused){
Snake.move();
Snake.paused = false;
}
else{
//如果沒有暫停,則停止移動
Snake.pause();
Snake.paused = true;
}
break;
}
case 37:{//left
//阻止蛇倒退走
if(Snake.direction==1){
break;
}
Snake.direction = 3;
break;
}
case 38:{//up
//快捷鍵在這里起作用
if(event.ctrlKey){
Snake.speedUp(-20);
break;
}
if(Snake.direction==2){//阻止蛇倒退走
break;
}
Snake.direction = 0;
break;
}
case 39:{//right
if(Snake.direction==3){//阻止蛇倒退走
break;
}
Snake.direction = 1;
break;
}
case 40:{//down
if(event.ctrlKey){
Snake.speedUp(20);
break;
}
if(Snake.direction==0){//阻止蛇倒退走
break;
}
Snake.direction = 2;
break;
}
}
}
},
//移動
move: function(){
this.timer = setInterval(function(){
Snake.erase();
Snake.moveOneStep();
Snake.paint();
}, this.speed);
},
//移動一節身體
moveOneStep: function(){
if(this.checkNextStep()==-1){
clearInterval(this.timer);
alert("Game over!\nPress Restart to continue.");
return;
}
if(this.checkNextStep()==1){
var _point = this.getNextPos();
var _x = _point.x;
var _y = _point.y;
var _color = this.getColor(_x,_y);
this.body.unshift({x:_x,y:_y,color:_color});
//因為吃了一個食物,所以再產生一個食物
this.generateDood();
return;
}
//window.status = this.toString();
var point = this.getNextPos();
//保留第一節的顏色
var color = this.body[0].color;
//顏色向前移動
for(var i=0; i<this.body.length-1; i++){
this.body[i].color = this.body[i+1].color;
}
//蛇尾減一節, 蛇尾加一節,呈現蛇前進的效果
this.body.pop();
this.body.unshift({x:point.x,y:point.y,color:color});
//window.status = this.toString();
},
//探尋下一步將走到什麼地方
pause: function(){
clearInterval(Snake.timer);
this.paint();
},
getNextPos: function(){
var x = this.body[0].x;
var y = this.body[0].y;
var color = this.body[0].color;
//向上
if(this.direction==0){
y--;
}
//向右
else if(this.direction==1){
x++;
}
//向下
else if(this.direction==2){
y++;
}
//向左
else{
x--;
}
//返回一個坐標
return {x:x,y:y};
},
//檢查將要移動到的下一步是什麼
checkNextStep: function(){
var point = this.getNextPos();
var x = point.x;
var y = point.y;
if(x<0||x>=this.colCount||y<0||y>=this.rowCount){
return -1;//觸邊界,游戲結束
}
for(var i=0; i<this.body.length; i++){
if(this.body[i].x==x&&this.body[i].y==y){
return -1;//碰到自己的身體,游戲結束
}
}
if(this.isCellFilled(x,y)){
return 1;//有東西
}
return 0;//空地
},
//擦除蛇身
erase: function(){
for(var i=0; i<this.body.length; i++){
this.eraseDot(this.body[i].x, this.body[i].y);
}
},
//繪制蛇身
paint: function(){
for(var i=0; i<this.body.length; i++){
this.paintDot(this.body[i].x, this.body[i].y,this.body[i].color);
}
},
//擦除一節
eraseDot: function(x,y){
this.tbl.rows[y].cells[x].style.backgroundColor = "";
},
paintDot: function(x,y,color){
this.tbl.rows[y].cells[x].style.backgroundColor = color;
},
//得到一個坐標上的顏色
getColor: function(x,y){
return this.tbl.rows[y].cells[x].style.backgroundColor;
},
//用於調試
toString: function(){
var str = "";
for(var i=0; i<this.body.length; i++){
str += "x:" + this.body[i].x + " y:" + this.body[i].y + " color:" + this.body[i].color + " - ";
}
return str;
},
//檢查一個坐標點有沒有被填充
isCellFilled: function(x,y){
if(this.tbl.rows[y].cells[x].style.backgroundColor == ""){
return false;
}
return true;
},
//重新開始
restart: function(){
if(this.timer){
clearInterval(this.timer);
}
for(var i=0; i<this.rowCount;i++){
this.tbl.deleteRow(0);
}
this.body = [];
this.init();
this.speed = 250;
},
//加速
speedUp: function(time){
if(!this.paused){
if(this.speed+time<10||this.speed+time>2000){
return;
}
this.speed +=time;
this.pause();
this.move();
}
},
//產生食物。
generateDood: function(){
var colors = ['red','orange','yellow','green','blue','purple','#ccc'];
var x = Math.floor(Math.random()*this.colCount);
var y = Math.floor(Math.random()*this.rowCount);
var colorIndex = Math.floor(Math.random()*7);
if(!this.isCellFilled(x,y)){
this.tbl.rows[y].cells[x].style.backgroundColor = colors[colorIndex];
}
}
};
</script>
<body onload="Snake.init();">
/*************************************************************<br />
* javascript貪吃蛇 v2.4<br />
* author: sunxing007 05/14/2009<br />
* 轉載請註明來自 <a href="http://blog.csdn.net/sunxing007">http://blog.csdn.net/sunxing007</a> 謝謝!<br />
**************************************************************/<br />
<table id="main" border="1" cellspacing="0" cellpadding="0"></table>
<input type="button" id="btn" value="開始/暫停" />點左邊按鈕或按Enter開始/暫停游戲<br />
<input type="button" id="reset" value="重新開始" /><br />
<input type="button" id="upSpeed" value="加速" />點左邊按鈕或按Ctrl + ↑加速<br />
<input type="button" id="downSpeed" value="減速" />點左邊按鈕或按Ctrl + ↓減速
<script>
$('btn').onclick = function(){
if(Snake.paused){
Snake.move();
Snake.paused = false;
}
else{
Snake.pause();
Snake.paused = true;
}
};
$("reset").onclick = function(){
Snake.restart();
this.blur();
};
$("upSpeed").onclick = function(){
Snake.speedUp(-20);
};
$("downSpeed").onclick = function(){
Snake.speedUp(20);
};
</script>
</body>
</html>