   Modulus
  int x;int y;I''ve been up coding for a few days and I''m just tuckering out and burning out of energy.  I''m racking my brains trying to figure out what is (obviously) a very easy solution.  I want ''x'' to increase once every time ''y'' increase by five, so:if y = 1 -> x = 0if y = 4 -> x = 0if y = 5 -> x = 1if y = 10 -> x = 2etc.I know it involves the mod operator but my brain is just turning into mush.  As soon as I figure this out I am implementing it and then I think I''m going to sleep for a few weeks.  Thanks for any suggestions! 
  Actually, it doesn''t involve the mod operator. It''s a lot simpler than that. It involves the division operator. Recall that in C++, integer division rounds down.   "Sneftel is correct, if rather vulgar." --Flarelocke ;  use integer math and divide y by five to find x... Wouldn't that work?[EDIT]Duhhh... Just a little too slow   [edited by - pjcast on February 4, 2004 1:48:58 PM];  What about a dirty brute force method :op heheehpresuming code is in a loop:/********************/int x;int y;int nexty = 5;if(y == nexty){    x++;    nexty = y+5;}else    y++;/********************/eeeuuuuaackkk...ok it''s distgusting but it''ll probably work ;O) ;  Wouldn''t this just do it?if(y % 5 == 0)    x++;  --{You fight like a dairy farmer!} 