锘??xml version="1.0" encoding="utf-8" standalone="yes"?>精品国产日韩久久亚洲,亚洲中文无码永久免,亚洲a在线视频视频http://www.tkk7.com/cisco/category/5583.htmlJava, 涓鏉祿嫻撶殑鍜栧暋浼翠綘鍒版繁澶?lt;br> <span id="dict_daily"> <a target="_blank">Dict.CN 鍦ㄧ嚎璇嶅吀, 鑻辮瀛︿範(fàn), 鍦ㄧ嚎緲昏瘧</a> </span> <script language="JavaScript" src="http://dict.cn/daily.php" defer="defer"> </script>zh-cnWed, 28 Feb 2007 07:05:29 GMTWed, 28 Feb 2007 07:05:29 GMT60Release three tiny programs I madehttp://www.tkk7.com/cisco/archive/2005/12/04/22391.htmlScott@JAVAScott@JAVASat, 03 Dec 2005 19:33:00 GMThttp://www.tkk7.com/cisco/archive/2005/12/04/22391.htmlhttp://www.tkk7.com/cisco/comments/22391.htmlhttp://www.tkk7.com/cisco/archive/2005/12/04/22391.html#Feedback0http://www.tkk7.com/cisco/comments/commentRss/22391.htmlhttp://www.tkk7.com/cisco/services/trackbacks/22391.htmlJAlarm -- Set your own alarm on PC with the sound you like
Develop under: WinXP + Eclipse 3.1 + SWT 3.1 + JDK 5.0



Download: http://www.cc.puv.fi/~e0300481/download/JAlarm_beta-win32_x86_no_jre.zip
 

WeatherNow - weather display program (Vaasa, Finland only)
Develop under: WinXP + Eclipse 3.1 + SWT 3.1 + JDK 5.0



Download: http://www.cc.puv.fi/~e0300481/download/WeatherNow_beta-win32_x86_no_jre.zip


JNotepad - Java Win Notepad
Develop under: WinXP + Eclipse 3.1 + SWT 3.1 + JDK 5.0



Download: http://www.cc.puv.fi/~e0300481/download/JNotepad_beta-win32_x86_no_jre.zip


Please check the "ReadMe.txt" file for more details, after you unpack the zip file.
Source codes are included together with the application programs, do not hesitate to criticise on my codes, your recommand will make a difference.
Thanks :)

Scott@JAVA 2005-12-04 03:33 鍙戣〃璇勮
]]>
GOOGLE鎸戞垬璧涚粌涔?fàn)棰?http://www.tkk7.com/cisco/archive/2005/12/01/22139.htmlScott@JAVAScott@JAVAThu, 01 Dec 2005 09:49:00 GMThttp://www.tkk7.com/cisco/archive/2005/12/01/22139.htmlhttp://www.tkk7.com/cisco/comments/22139.htmlhttp://www.tkk7.com/cisco/archive/2005/12/01/22139.html#Feedback0http://www.tkk7.com/cisco/comments/commentRss/22139.htmlhttp://www.tkk7.com/cisco/services/trackbacks/22139.htmlProblem Statement

A simple line drawing program uses a blank 20 x 20 pixel canvas and a directional cursor that starts at the upper left corner pointing straight down. The upper left corner of the canvas is at (0, 0) and the lower right corner is at (19, 19). You are given a string[], commands, each element of which contains one of two possible commands. A command of the form "FORWARD x" means that the cursor should move forward by x pixels. Each pixel on its path, including the start and end points, is painted black. The only other command is "LEFT", which means that the cursor should change its direction by 90 degrees counterclockwise. So, if the cursor is initially pointing straight down and it receives a single "LEFT" command, it will end up pointing straight to the right. Execute all the commands in order and return the resulting 20 x 20 pixel canvas as a string[] where character j of element i represents the pixel at (i, j). Black pixels should be represented as uppercase 'X' characters and blank pixels should be represented as '.' characters.

Definition

Class: DrawLines
Method: execute
Parameters: string[]
Returns: string[]
Method signature: string[] execute(string[] commands)

(be sure your method is public)


鎴戠殑紼嬪簭錛?BR>
public class DrawLines {
    
// current cursor position
    private int xPos, yPos;

    
private int direction;

    
private char[][] canvas;

    
public DrawLines() {
        xPos 
= 0;
        yPos 
= 0;
        
// initial drawing direction downwards
        direction = 270;
        canvas 
= new char[20][20];
    }


    
private void initCanvas() {
        
for (int i = 0; i < 20; i++)
            
for (int j = 0; j < 20; j++)
                canvas[i][j] 
= '.';
    }


    
public String[] excute(String[] commands) {
        initCanvas();
        
for (int i = 0; i < commands.length; i++{
            
if (commands[i].equals("LEFT")) {
                
// when come cross "LEFT", turn 90 degrees couter-clockwise
                direction += 90;
                
if (direction == 360)
                    direction 
= 0;
            }
 else {
                
int len = Integer.parseInt(commands[i].split(" ")[1]);
                
switch (direction) {
                
case 0:
                    
// draw from left to right
                    for (int j = 0; j <= len; j++)
                        canvas[xPos][yPos
++= 'X';
                    yPos
--;
                    
break;
                
case 90:
                    
// draw from down to up
                    for (int j = 0; j <= len; j++)
                        canvas[xPos
--][yPos] = 'X';
                    xPos
++;
                    
break;
                
case 180:
                    
// draw from right to left
                    for (int j = 0; j <= len; j++)
                        canvas[xPos][yPos
--= 'X';
                    yPos
++;
                    
break;
                
case 270:
                    
// draw from up to down
                    for (int j = 0; j <= len; j++)
                        canvas[xPos
++][yPos] = 'X';
                    xPos
--;
                    
break;
                }

            }

        }

        String[] s 
= new String[20];
        
for (int i = 0; i < 20; i++)
            s[i] 
= new String(canvas[i]);
        
return s;
    }


    
public static void main(String[] args) {
        String[] cmds 
= "LEFT""FORWARD 19""LEFT""LEFT""LEFT",
                
"FORWARD 18""LEFT""LEFT""LEFT""FORWARD 17""LEFT",
                
"LEFT""LEFT""FORWARD 16""LEFT""LEFT""LEFT",
                
"FORWARD 15""LEFT""LEFT""LEFT""FORWARD 14""LEFT",
                
"LEFT""LEFT""FORWARD 13""LEFT""LEFT""LEFT",
                
"FORWARD 12""LEFT""LEFT""LEFT""FORWARD 11""LEFT",
                
"LEFT""LEFT""FORWARD 10""LEFT""LEFT""LEFT",
                
"FORWARD 9""LEFT""LEFT""LEFT""FORWARD 8""LEFT",
                
"LEFT""LEFT""FORWARD 7" }
;
        DrawLines drawLines 
= new DrawLines();
        String[] s 
= drawLines.excute(cmds);
        
for (int i = 0; i < 20; i++)
            System.out.println(s[i]);
    }

}


Scott@JAVA 2005-12-01 17:49 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲精品国产成人专区| 成人性生交大片免费看好| 一级毛片免费观看| 亚洲综合国产一区二区三区| 亚洲成av人片在线天堂无| 成人免费午夜在线观看| 亚洲视频精品在线观看| 午夜不卡久久精品无码免费| 亚洲国产精品久久网午夜| 91成年人免费视频| 亚洲国产理论片在线播放| 在线人成精品免费视频| 亚洲国产精品免费视频| 日韩高清免费观看| 亚洲人成色777777老人头| A级毛片内射免费视频| 一二三区免费视频| 亚洲国产一区二区三区| 一进一出60分钟免费视频| 亚洲综合无码一区二区三区| 18女人腿打开无遮掩免费| 亚洲大片免费观看| 亚洲男人第一无码aⅴ网站| 日韩中文字幕精品免费一区| 亚洲sss综合天堂久久久| 免费毛片网站在线观看| 免费一级特黄特色大片| 亚洲国产精品尤物YW在线观看| 无码免费又爽又高潮喷水的视频 | 59pao成国产成视频永久免费| MM1313亚洲精品无码久久| 亚洲国产免费综合| 国产精品入口麻豆免费观看| aaa毛片视频免费观看| 亚洲精品国产肉丝袜久久| 国产亚洲精品无码专区| 8888四色奇米在线观看免费看| 无套内谢孕妇毛片免费看看| 国产成人精品日本亚洲专一区| 亚洲AV色香蕉一区二区| 插B内射18免费视频|