I have the following code
//var r, t, y, f, g, h, c, v, b
switch(event.key) {
case 'r' : input.execute("game_stats_build " + r);
break;
case 't': input.execute("game_stats_build " + t);
break;
case 'y': input.execute("game_stats_build " + y);
break;
case 'f': input.execute("game_stats_build " + f);
break;
case 'g': input.execute("game_stats_build " + g);
break;
case 'h': input.execute("game_stats_build " + h);
break;
case 'v': input.execute("game_stats_build " + v);
break;
case 'b': input.execute("game_stats_build " + b);
break;
}
It's redundant and every time I make a change I have to do a lot of typing. How can I write this better?