锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产精品13p,久久精品夜色噜噜亚洲A∨,18亚洲男同志videos网站http://m.tkk7.com/cisco/category/5583.htmlJava, 涓鏉祿嫻撶殑鍜栧暋浼翠綘鍒版繁澶?lt;br> <span id="dict_daily"> <a target="_blank">Dict.CN 鍦ㄧ嚎璇嶅吀, 鑻辮瀛︿範, 鍦ㄧ嚎緲昏瘧</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://m.tkk7.com/cisco/archive/2005/12/04/22391.htmlScott@JAVAScott@JAVASat, 03 Dec 2005 19:33:00 GMThttp://m.tkk7.com/cisco/archive/2005/12/04/22391.htmlhttp://m.tkk7.com/cisco/comments/22391.htmlhttp://m.tkk7.com/cisco/archive/2005/12/04/22391.html#Feedback0http://m.tkk7.com/cisco/comments/commentRss/22391.htmlhttp://m.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鎸戞垬璧涚粌涔犻1http://m.tkk7.com/cisco/archive/2005/12/01/22139.htmlScott@JAVAScott@JAVAThu, 01 Dec 2005 09:49:00 GMThttp://m.tkk7.com/cisco/archive/2005/12/01/22139.htmlhttp://m.tkk7.com/cisco/comments/22139.htmlhttp://m.tkk7.com/cisco/archive/2005/12/01/22139.html#Feedback0http://m.tkk7.com/cisco/comments/commentRss/22139.htmlhttp://m.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| 一级毛片成人免费看免费不卡| 亚洲另类少妇17p| 亚洲欧洲日产国码久在线| 67pao强力打造高清免费| 亚洲理论电影在线观看| 老司机午夜在线视频免费| 免费做爰猛烈吃奶摸视频在线观看 | 久久精品国产亚洲av天美18| 1000部拍拍拍18免费网站| 亚洲AV无码精品无码麻豆| 又粗又长又爽又长黄免费视频| 四虎www免费人成| 91亚洲精品自在在线观看| 日韩精品无码一区二区三区免费| 亚洲性在线看高清h片| 国产亚洲精品欧洲在线观看| 久久这里只有精品国产免费10| 7777久久亚洲中文字幕蜜桃| 18禁在线无遮挡免费观看网站| 亚洲欧洲精品成人久久奇米网| 在线播放亚洲精品| 精品国产免费观看久久久| 亚洲a视频在线观看| 亚欧在线精品免费观看一区| 亚洲综合国产精品| 色欲国产麻豆一精品一AV一免费| 亚洲精品少妇30p| 国产精品免费久久久久电影网| 亚洲男人在线无码视频| 日韩一区二区三区免费播放| 免费看一级做a爰片久久| 亚洲av纯肉无码精品动漫| 免费羞羞视频网站| 亚洲啪AV永久无码精品放毛片| 国内自产拍自a免费毛片| 亚洲av永久无码一区二区三区|