This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Simple Snake Game in Python 3 for Beginners | |
| # By @TokyoEdTech | |
| import turtle | |
| import time | |
| import random | |
| delay = 0.1 | |
| # Score |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <input id="city"> | |
| <button onclick="checkCity()">OK</button> | |
| <div id="result">..</div> | |
| <script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var n = 16 | |
| //n stores the number of blocks that can be used to built the pyramid | |
| var layer = 1 | |
| //layer stores the initial count for the number of blocks in the layer | |
| var printed = 0 | |
| //printed stores count of | |
| var buffer = "" | |
| for (var i=0; i<n; i++) //iterate over the number of blocks in the pyramid | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //solution 1 | |
| fucntion maximum(a,b){ | |
| if (a>b){ | |
| return a | |
| } else { | |
| return b | |
| } | |
| //solution 2 | |
| funciton maximum(a.b){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //USING TERNARY // kode teh | |
| function maximum(a,b){ | |
| return a>b ? a : b | |
| } | |
| console.log(maximum(4,7) ) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.