World

by harps116

HTML

<!-- logging outside the console -->
  <pre><script>
    function log(arg){
      document.writeln(arg);
      document.write('<br/>')
    }
  </script></pre>

JavaScript

var sun = false
    day = 0;
    
var world = {
	deg : 0,
  spin : function(){
  	while(day <= 1){
    	this.deg += 1
      day += 0.00273972602;
      if(this.deg <= 180){
      log(`it's daytime`)
      sun = true;
      }else{
      log(`it's nightime`)
      sun = false;
      }
    }  
  }
}
world.spin()