View Single Post
  #8  
Old January 6th, 2009, 05:39 AM
HallsofIvy HallsofIvy is offline
MHF Contributor
 
Join Date: Apr 2005
Posts: 3,301
Thanks: 291
Thanked 1,161 Times in 1,063 Posts
HallsofIvy has much to be proud ofHallsofIvy has much to be proud ofHallsofIvy has much to be proud ofHallsofIvy has much to be proud ofHallsofIvy has much to be proud ofHallsofIvy has much to be proud ofHallsofIvy has much to be proud ofHallsofIvy has much to be proud ofHallsofIvy has much to be proud of
Default

Quite frankly, the simplest way to write a program to find integers X and Y such that Offset = Y * 160 + X * 2 for a given "offset" is first to write X= (Offset- 160Y)/2 and then step through integer values for Y until you find one that gives X integer also.
Reply With Quote