5 static string [] types = {
13 static void w (string s)
18 static void wl (string s)
20 Console.WriteLine (s);
23 static void generate_receptors ()
25 foreach (string t in types){
26 w ("\tstatic void receive_" + t + " (" + t + " a)\n\t{\n");
27 w ("\t\tConsole.Write (\" \");\n");
28 w ("\t\tConsole.WriteLine (a);\n");
34 static void var (string type, string name, string init)
36 w ("\t\t" + type + " " + name + " = (" + type + ") " + init + ";\n");
39 static void call (string type, string name)
41 w ("\t\treceive_" + type + " (unchecked ((" + type + ") " + name + "));\n");
44 static void generate_emision ()
46 foreach (string type in types){
47 w ("\tstatic void probe_" + type + "()\n\t{\n");
48 var (type, "zero", "0");
49 var (type, "min", type + ".MinValue");
50 var (type, "max", type + ".MaxValue");
53 wl ("\t\tConsole.WriteLine (\"Testing: " + type + "\");\n");
54 foreach (string t in types){
55 wl ("\t\tConsole.WriteLine (\" arg: " + t + "\");\n");
65 static void generate_main ()
67 wl ("\tstatic void Main ()\n\t{");
69 foreach (string t in types){
70 w ("\t\tprobe_" + t + " ();\n");
77 wl ("using System;\nclass Test {\n");
79 generate_receptors ();