Skip to content

Instantly share code, notes, and snippets.

View puyepuye's full-sized avatar

Sataphon Obra puyepuye

  • Toronto
View GitHub Profile
@puyepuye
puyepuye / snake_game.py
Last active June 2, 2022 07:45 — forked from wynand1004/snake_game.py
A Simple Snake Game made in Python 3
# Simple Snake Game in Python 3 for Beginners
# By @TokyoEdTech
import turtle
import time
import random
delay = 0.1
# Score
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<input id="city">
<button onclick="checkCity()">OK</button>
<div id="result">..</div>
<script>
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
{
//solution 1
fucntion maximum(a,b){
if (a>b){
return a
} else {
return b
}
//solution 2
funciton maximum(a.b){
@puyepuye
puyepuye / TernaryFindMax
Created February 8, 2022 13:15
Using Ternary Operator to find the maximum.
//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.