32bit_me (32bit_me) wrote,
32bit_me
32bit_me

Как это работает?

Originally published at 32 bit.me. You can comment here or there.

switch ((rand() >> 8) % 3) 
//the ">> 8" (typically) improves the period of the lowest 2 bits
       case 0: DoSmth();
       case 1: DoSmth1();
       case 2: DoSmth2();
     }
Tags: c++, программирование
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 1 comment