Skip to content

Instantly share code, notes, and snippets.

View themisir's full-sized avatar
🐒
monke sees, monke does

Misir themisir

🐒
monke sees, monke does
View GitHub Profile
@themisir
themisir / snike.html
Last active February 13, 2018 20:52
SNIKE (not snake) game source code. Full source code of (https://codepen.io/misir-ceferov/pen/bLRPaW)
<!--
DEVELOPED BY: OneDev Group
WEBSITE: https://onedevgroup.com
PLAY ONLINE: https://goo.gl/d8nya2
FULL SOURCE CODE: https://goo.gl/GqpTAh
DEVELOPED FOR: https://youtu.be/fteA6mOZjXw
-->
<style type="text/css">
#wrapper canvas,
#wrapper.playing menu {
@themisir
themisir / fragment.php
Created June 18, 2018 10:28
Html sənədi daxilində php
<!doctype html>
<html>
<head>
...
</head>
<body>
<h1><?php echo 'Salam, Dünya!'; ?></h1>
</body>
</html>
@themisir
themisir / helloworld.php
Created June 18, 2018 10:39
İlk php proqramım
<?php
echo 'Salam, Dünya!';
?>
<?php
define('CONSTANT_1', 12);
define('CONSTANT_2', 'Kodera');
define('CONSTANT_3', 'Salam, '.CONSTANT_2);
const CONSTANT_4 = 'Mən sabitəm';
?>
<?php
$deyisen_1 = 10;
function calculate()
{
echo $deyisen_1;
}
calculate();
?>
<?php
$deyisen_1 = 'Qiymeti';
$deyisen_2 = 35;
$deyisen_3 = 1 + 2;
?>
class Rectangle {
public float x;
public float y;
public float width;
public float height;
public float left() {
return this.x;
}
public float top() {
return this.y;
class Circle {
public float x;
public float y;
public float radius;
public void set(float x, float y, float radius) {
this.x = x;
this.y = y;
this.radius = radius;
}
public Circle(float x, float y, float radius) {
public boolean collides(Rectangle r1, Rectangle r2) {
return
(r2.left() >= r1.left() && r2.left() <= r1.right()) ||
(r2.right() >= r1.left() && r2.right() <= r1.right()) ||
(r2.top() >= r1.top() && r2.top() <= r1.bottom()) ||
(r2.bottom() >= r1.top() && r2.bottom() <= r1.bottom());
}
private boolean clamp(float value, float min, float max) {
return Math.max(min, Math.min(max, value));
}
public boolean collides(Rectangle r1, Circle c1) {
float cx = clamp(c1.x, r1.left(), r1.right());
float cy = clamp(c1.y, r1.top(), r1.bottom());
...
}