锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产精品13p,久久精品夜色噜噜亚洲A∨,18亚洲男同志videos网站http://www.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://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鎸戞垬璧涚粌涔犻1http://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 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲国产成人精品女人久久久 | 久久亚洲精品人成综合网| 国产高清对白在线观看免费91| 一区二区三区亚洲视频| 免费国产污网站在线观看不要卡| 亚洲福利视频一区二区| 国产精品免费看久久久香蕉 | 久久久久亚洲AV成人网人人网站 | 亚洲人成电影在线观看网| 无码国产精品一区二区免费式直播 | 免费在线看片网站| 在线看亚洲十八禁网站| 亚洲人成电影网站国产精品| 黄色短视频免费看| 亚洲国产综合精品中文第一区 | 国产男女性潮高清免费网站| 免费一区二区无码视频在线播放| vvvv99日韩精品亚洲| 中文字幕乱理片免费完整的| 亚洲AV无码成人专区片在线观看 | 日本高清色本免费现在观看| 免费的黄色的网站| 亚洲韩国精品无码一区二区三区 | 免费国产a国产片高清| aa级女人大片喷水视频免费| 日木av无码专区亚洲av毛片| 好大好硬好爽免费视频| 色多多A级毛片免费看| 亚洲av激情无码专区在线播放| 久热中文字幕在线精品免费| 国产99久久亚洲综合精品| 亚洲码国产精品高潮在线| 最近中文字幕mv免费高清视频8| 亚洲人成网站色7799| 亚洲中文字幕在线第六区| 亚洲AV无码乱码国产麻豆| 国产麻豆视频免费观看| 男女男精品网站免费观看| 久久久久久久亚洲Av无码| 国产美女无遮挡免费网站| 国产精品免费高清在线观看|