2015年5月21日 星期四

紐柏林(Nürburgring)北環 SIXT 德意志奔馳 德國自駕租車 2015 德國行 Day 5-1

#紐柏林 #SIXT #德國
這次旅行的前一週,就收到德鐵罷工的資訊,在加上要去紐柏林(Nürburgring) 雖然可以靠火車+bus 不過變數太多(要轉四次車)
所以還是決定以自駕的方式前往紐柏林





前一晚住的城市是科布倫茲(Koblenz) 萊茵河跟摩塞爾河交接處的一個城市,著名的景點叫做德意志之角(Deutsches Eck)
非常漂亮的地方,這個城市有兩千多年的歷史了,2002年起德意志之角作為萊茵河中上游河谷的一部分,也入選聯合國科教文組織世界遺產名錄

 

2010年11月26日 星期五

2010-11-26

檔案連結


using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
namespace WindowsGame1
{
    /// <summary>
    /// This is the main type for your game
    /// </summary>
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;
        SpriteFont font;
        Texture2D ball;
        Texture2D background;
        AnimatedTexture aniTex;
        Vector2 ballPosition;
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
        }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            spriteBatch = new SpriteBatch(GraphicsDevice);
            ballPosition = new Vector2(20, 20);
            base.Initialize();
        }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            font = Content.Load<SpriteFont>("spritefont1");
            spriteBatch = new SpriteBatch(GraphicsDevice);
            ball = Content.Load<Texture2D>("ball");
            spriteBatch = new SpriteBatch(GraphicsDevice);  
            background = Content.Load<Texture2D>("B1_nebula01");
            spriteBatch = new SpriteBatch(GraphicsDevice);  
            aniTex = new AnimatedTexture(Content.Load<Texture2D>("doing_magic"), 3, 80);
            // TODO: use this.Content to load your game content here
        }
        /// <summary>
        /// UnloadContent will be called once per game and is the place to unload
        /// all content.
        /// </summary>
        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
        }
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)  
                this.Exit(); 
               aniTex.Update(gameTime); 
            // TODO: Add your update logic here
            base.Update(gameTime);
        }
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);
            // TODO: Add your drawing code here
            graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
            spriteBatch.Begin();
           
            spriteBatch.Draw(background, Vector2.Zero, Color.White);
            spriteBatch.Draw(ball, ballPosition, Color.White);
            aniTex.Render(spriteBatch, Vector2.Zero, Color.White);
           
            spriteBatch.DrawString(font, "kuo chi yuan <kax0205x@hotmail.com>", new Vector2(90, 500), Color.Black);
            spriteBatch.End();

            base.Draw(gameTime);
        }
    }
}




class1 中

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
namespace WindowsGame1
{
    class AnimatedTexture
    {
         private Texture2D aniTex; 
        private int CurrentFrame = 0; 
        private int numberOfFrames = 0;  
        private int msBetweenFrames = 0;  
           private Rectangle rect; 
        private int width = 0;
        private int height = 0; 
            float timer = 0;
            public AnimatedTexture(Texture2D texture, int numFrames, int msBetweenFrames)
            {
                this.aniTex = texture; this.numberOfFrames = numFrames;
                this.msBetweenFrames = msBetweenFrames;
                this.width = texture.Width / numberOfFrames;
                this.height = texture.Height;
                // Init rectangle       
                rect.X = 0;
                rect.Y = 0;
                rect.Width = width;
                rect.Height = height;
            }
            public void Update(GameTime gametime)
            {
                timer += gametime.ElapsedGameTime.Milliseconds;
                if (timer >= msBetweenFrames)
                {
                    timer = 0;
                    if (CurrentFrame++ == numberOfFrames - 1)
                        CurrentFrame = 0;
                    rect.X = CurrentFrame * width;
                    rect.Y = 0;
                }
            }
            public void Render(SpriteBatch sb, Vector2 position, Color color)
            {
                sb.Draw(aniTex, position, rect, color, 0, Vector2.Zero, 2.0f, SpriteEffects.None, 0);
            }
   
    }
}

2010年11月18日 星期四

2010-11-18 考試 紅綠燈

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        int i;
        int j;
        public Form1()
        {
            InitializeComponent();
             i=0;
             j = 0;
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            button1.Enabled = false;
            button2.Enabled = false;
            button3.Enabled = false;
        
            i++;
            i = i % 6;
            label1.Text = Convert.ToString(i);
                 j++;
                j=j%6;
              switch(j)
            {
                case 0:
                button1.Enabled=true;
                button2.Enabled = false;
                button3.Enabled = false;
                break;
                case 1:
                button1.Enabled = false;
                button2.Enabled=true;
                button3.Enabled = false;
                break;
                case 2:
                button1.Enabled = false;
                button2.Enabled = false;
                button3.Enabled=true;
                               
                break;
                case 3:
                button1.Enabled = false;
                button2.Enabled = false;
                button3.Enabled = true;
                break;
                case 4:
                button1.Enabled = false;
                button2.Enabled = false;
                button3.Enabled = true;
                break;
                case 5:
                button1.Enabled = false;
                button2.Enabled = false;
                button3.Enabled = true;
                break;
            }
        }
        private void label1_Click(object sender, EventArgs e)
        {
           
        }
    }
}

2010年11月12日 星期五

11-12 計算機 正確

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public string str = ""; //把數字鍵字串存起來
        public double ans = 0;//佔存變數  
        public int how = 0;//判斷按下+ - * /
   

        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
        }
        private void button16_Click(object sender, EventArgs e)
        {
            str = "";    //顯示0
            textBox1.Text = "0";

        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (str == "0") { str = ""; }//數字鍵1
            str += "1";
            textBox1.Text = str;//顯示字串內容

        }
        private void button2_Click(object sender, EventArgs e)
        {
            if (str == "0") { str = ""; }//數字鍵2
            str += "2";
            textBox1.Text = str;

        }
        private void button3_Click(object sender, EventArgs e)
        {
            if (str == "0") { str = ""; }//數字鍵3
            str += "3";
            textBox1.Text = str;
        }
        private void button4_Click(object sender, EventArgs e)
        {
            if (str == "0") { str = ""; }
            str += "4";
            textBox1.Text = str;
        }
        private void button5_Click(object sender, EventArgs e)
        {
            if (str == "0") { str = ""; }
            str += "5";
            textBox1.Text = str;
        }
        private void button6_Click(object sender, EventArgs e)
        {
            if (str == "0") { str = ""; }
            str += "6";
            textBox1.Text = str;
        }
        private void button7_Click(object sender, EventArgs e)
        {
            if (str == "0") { str = ""; }
            str += "7";
            textBox1.Text = str;
        }
        private void button8_Click(object sender, EventArgs e)
        {
            if (str == "0") { str = ""; }
            str += "8";
            textBox1.Text = str;
        }
        private void button9_Click(object sender, EventArgs e)
        {
            if (str == "0") { str = ""; }
            str += "9";
            textBox1.Text = str;
        }
        private void button15_Click(object sender, EventArgs e)
        {
      
            if (str != "")//點擊=鍵
            { 
               if (how == 1) { ans += Convert.ToDouble(str); }//轉換成浮點數
               else if (how == 2) { ans -= Convert.ToDouble(str); }
               else if (how == 3) { ans *= Convert.ToDouble(str); }
               else if (how == 4) { ans /= Convert.ToDouble(str); }
               else if (ans == 0) { ans = Convert.ToDouble(str); }
             
               else ans = Convert.ToDouble(str);
            }

            how = 0;//再儲存使用者所按下的運算元

            str = Convert.ToString(ans);
          
                    
            textBox1.Text = str;
            label1.Text = "=";

        }
        private void button11_Click(object sender, EventArgs e)
        {
            if (how == 1)
            { if (str == "") { str = "0"; };ans += Convert.ToDouble(str); }
            else if (how == 2)
            { if (str == "") { str = "0"; };ans -= Convert.ToDouble(str); }
            else if (how == 3)
            { if (str == "") { str = "1"; };ans *= Convert.ToDouble(str); }
            else if (how == 4)
            { if (str == "") { str = "1"; };ans /= Convert.ToDouble(str); }
            else if (how == 0)
            { if (str == "") { str = "0"; } ans = Convert.ToDouble(str); }
            textBox1.Text = Convert.ToString(ans);

            how = 1;
          
            str = "";

        }
        private void button12_Click(object sender, EventArgs e)
        {
            if (how == 1)
            { if (str == "") { str = "0"; };ans += Convert.ToDouble(str); }
            else if (how == 2)
            { if (str == "") { str = "0"; };ans -= Convert.ToDouble(str); }
            else if (how == 3)
            { if (str == "") { str = "1"; };ans *= Convert.ToDouble(str); }
            else if (how == 4)
            { if (str == "") { str = "1"; };ans /= Convert.ToDouble(str); }
            else if (how == 0)
            { if (str == "") { str = "0"; } ans = Convert.ToDouble(str); }
            textBox1.Text = Convert.ToString(ans);

            how = 2;
          
            str = "";

        }
        private void button13_Click(object sender, EventArgs e)
        {
            if (how == 1)
            { if (str == "") { str = "0"; };ans += Convert.ToDouble(str); }
            else if (how == 2)
            { if (str == "") { str = "0"; };ans -= Convert.ToDouble(str); }
            else if (how == 3)
            { if (str == "") { str = "1"; };ans *= Convert.ToDouble(str); }
            else if (how == 4)
            { if (str == "") { str = "1"; };ans /= Convert.ToDouble(str); }
            else if (how == 0)
            { if (str == "") { str = "0"; } ans = Convert.ToDouble(str); }
            textBox1.Text = Convert.ToString(ans);

            how = 3;
           
            str = "";

        }
        private void button14_Click(object sender, EventArgs e)
        {
            if (how == 1)
            { if (str == "") { str = "0"; };ans += Convert.ToDouble(str); }
            else if (how == 2)
            { if (str == "") { str = "0"; };ans -= Convert.ToDouble(str); }
            else if (how == 3)
            { if (str == "") { str = "1"; };ans *= Convert.ToDouble(str); }
            else if (how == 4)
            { if (str == "") { str = "1"; };ans /= Convert.ToDouble(str); }
            else if (how == 0)
            { if (str == "") { str = "0"; } ans = Convert.ToDouble(str); }
            textBox1.Text = Convert.ToString(ans);

            how = 4;
           
            str = "";

        }
        private void button10_Click(object sender, EventArgs e)
        {
            if (str == "0") { str = ""; }
            str += "0";
        }
    }
}