package game.classes {
	
	import flash.display.MovieClip;
	
	
	
	
	public class measureHunt extends MovieClip {
		
		
		public function measureHunt() {
			// constructor code
			trace("derp");
		}
		public function randomRange(minNum:Number, maxNum:Number):Number   
            {  
               return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);  
             } 
	    public function roundToNearest(roundTo:Number, value:Number):Number{
                        return Math.round(value/roundTo)*roundTo;
              }
			  
	    public function xyMoveNum(valNum:Number,startVal:Number):Number{
			     var diff:Number = startVal - valNum;
			     var newNumber:Number = new Number();
				 var diffLeftover:Number = diff%100;
				 trace("difference: " + diff + " diff%100=" + diff%100);
				 if(diffLeftover < 25){
					 newNumber = Math.floor(diff/100);
					 if(newNumber ==0){
						 newNumber = newNumber+1;
					 }
					 newNumber=100*newNumber;
					 
				 }
				 if(diffLeftover > 26 && diffLeftover < 75){
					 trace("between 26 and 75");
					newNumber = Math.floor(diff/100);
					newNumber = (newNumber*100) + 50;
					
				  }
				  if(diffLeftover > 75 && diffLeftover < 100){
					newNumber = Math.ceil(diff/100);
					if(newNumber ==0){
						 newNumber = newNumber+1;
					 }
					 newNumber=100*newNumber;
				  }
			   //trace(newNumber);
		         return newNumber;
		       }
			   public function xyMove(startVal:Number,valNum:Number):String{
			     var diff:Number = valNum-startVal;
			     var newNumber:String = new String();
				 if(valNum%100 > 25){
					 newNumber = Math.floor(diff/100).toString();
					 return newNumber;
				 }
				 if(valNum%100 > 50){
					newNumber = Math.floor(diff/100).toString();
					newNumber = newNumber + "-1/2";
					return newNumber;
				  }
				  if(valNum%100 > 75){
					newNumber = Math.floor(diff/100).toString();
					newNumber = newNumber + "-1/2";
					  newNumber = (diff/100).toString();				  
				  }
				  if(valNum%100 > 100){
					newNumber = Math.ceil(diff/100).toString();
				  }
			    trace(newNumber);
		         return newNumber;
		       }
			 
			
	}
	
}
