Converting DICE from BASIC to C