Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private string BaseCommand = "*objset ";
- public string BZBux_LVZ(double newscore, double oldscore)
- {
- string LvzCommand = BaseCommand;
- int[] display = new int[] {0,10,20,30,40,50,60,70,80};
- int new_score = (int)(newscore * 100);
- int old_score = (int)(oldscore * 100);
- char[] converted = (new_score.ToString().PadLeft(9,'0')).ToCharArray();
- char[] old_converted = (old_score.ToString().PadLeft(9, '0')).ToCharArray();
- for (int i = 0; i < 9; i++)
- {
- int old_digit = (display[i] + int.Parse(old_converted[i].ToString()));
- int new_digit = (display[i] + int.Parse(converted[i].ToString()));
- if (old_digit != new_digit)
- {
- LvzCommand = LvzCommand + "+" + new_digit + ",-" + old_digit + ",";
- }
- }
- return LvzCommand;
- }
Advertisement
Add Comment
Please, Sign In to add comment