mirror of
				https://github.com/coolaj86/fizzbuzz.git
				synced 2024-11-16 17:29:04 +00:00 
			
		
		
		
	simpler fizzbuzz
This commit is contained in:
		
							parent
							
								
									1b0eaf292e
								
							
						
					
					
						commit
						036579b986
					
				
							
								
								
									
										18
									
								
								fizzbuzz.js
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								fizzbuzz.js
									
									
									
									
									
								
							| @ -2,20 +2,12 @@ | ||||
| "use strict"; | ||||
| var sys = require('sys'); | ||||
| (function () { | ||||
|   var i, n; | ||||
|   var i, msg; | ||||
|   for (i = 1; i <= 100; i += 1) { | ||||
|     n = false; | ||||
|     msg = ''; | ||||
| 
 | ||||
|     if (0 === (i % 3)) { | ||||
|       n = true; | ||||
|       sys.print("Fizz"); | ||||
|     } | ||||
|     if (0 === (i % 5)) { | ||||
|       n = true; | ||||
|       sys.print("Buzz"); | ||||
|     } | ||||
|     if (true === n) { | ||||
|       sys.print("\n"); | ||||
|     } | ||||
|     if (0 === (i % 3)) { msg += "Fizz"; } | ||||
|     if (0 === (i % 5)) { msg += "Buzz"; } | ||||
|     if (msg.length > 0) { console.log(msg); } | ||||
|   } | ||||
| }()); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user