A game attribute calculation implementation in C and write a driver by erlang nif