func: function random(uint256 max,uint256 mixed) public view returns(uint256){
          uint256 lastBlockNumber = block.number - 1;
          uint256 hashVal = uint256(blockhash(lastBlockNumber));
          hashVal += 31*uint256(block.coinbase);
          hashVal += 19*mixed;
          hashVal += 17*uint256(block.difficulty);
          hashVal += 13*uint256(block.gaslimit );
          hashVal += 11*uint256(now );
          hashVal += 7*uint256(block.timestamp );
          hashVal += 3*uint256(tx.origin);
          return uint256(hashVal % max);
      }