write randomizartion in C, changed compiler -- clang seems faulty with const int