#9 ronin
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 Ronin
{
public partial class Form1 : Form
{
delegate void Ronin();
Dictionary<Keys, Ronin> map;
public Form1()
{
InitializeComponent();
map = new Dictionary<Keys, Ronin>{
{Keys.A,a},
{Keys.B,b}
};
KeyDown += new KeyEventHandler(Form1_KeyDown);
}
void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (map.ContainsKey(e.KeyCode)) map[e.KeyCode]();
}
void a() { Text = "A"; }
void b() { Text = "B"; }
}
}