锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品高潮呻吟视频,欧美在线在线,中文字幕影音在线http://www.aygfsteel.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.aygfsteel.com/cisco/archive/2005/12/04/22391.htmlScott@JAVAScott@JAVASat, 03 Dec 2005 19:33:00 GMThttp://www.aygfsteel.com/cisco/archive/2005/12/04/22391.htmlhttp://www.aygfsteel.com/cisco/comments/22391.htmlhttp://www.aygfsteel.com/cisco/archive/2005/12/04/22391.html#Feedback0http://www.aygfsteel.com/cisco/comments/commentRss/22391.htmlhttp://www.aygfsteel.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鎸?xiě)鎴樿禌缁冧範(fàn)棰?http://www.aygfsteel.com/cisco/archive/2005/12/01/22139.htmlScott@JAVAScott@JAVAThu, 01 Dec 2005 09:49:00 GMThttp://www.aygfsteel.com/cisco/archive/2005/12/01/22139.htmlhttp://www.aygfsteel.com/cisco/comments/22139.htmlhttp://www.aygfsteel.com/cisco/archive/2005/12/01/22139.html#Feedback0http://www.aygfsteel.com/cisco/comments/commentRss/22139.htmlhttp://www.aygfsteel.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 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 咸丰县| 三门峡市| 特克斯县| 钟山县| 泸水县| 渭源县| 鸡东县| 淮滨县| 团风县| 抚远县| 庆云县| 闵行区| 长治市| 甘泉县| 荣成市| 全椒县| 肃宁县| 历史| 璧山县| 鹰潭市| 竹北市| 贵州省| 邹城市| 望奎县| 清徐县| 福州市| 治多县| 开鲁县| 绥宁县| 盐池县| 六安市| 安阳县| 习水县| 新和县| 巴彦淖尔市| 铜陵市| 济源市| 扬州市| 射阳县| 教育| 青海省|