谁帮忙给我改个算法啊~~急
using System;using System.Collections.Generic;
using System.Text;
using
namespace RollMethod
{
public class RollMethod : VoteMethod.MethodPluginInterface
{
int[] ieggs = new int[16] { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0 };
int[] pv = new int[16] { 121, 72, 38, 29, 14, 10, 8, 7, 7, 8, 10, 14, 23, 38, 77, 213 };
public int[] getValue(int[] eggs, int code)
{
for (int i = 0; i < 16; i++)
{
if (eggs[i] != 0)
{
int oddegg = eggs[i];
while (true)
{
eggs[i] = eggs[i] + 1;
if ((eggs[i] - oddegg) * pv[i] > oddegg)
{
break;
}
}
}
}
if (eggs[code - 3] != 0)
{
eggs[code - 3] = ieggs[code - 3];
}
return eggs;
}
public int[] getIniValue()
{
int[] eggs = new int[16] { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0};
return eggs;
}
}
}