This file contains 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
from browser import document, html, window | |
from javascript import Math | |
score = 0 | |
high_score = 0 | |
px = py = 10 | |
gs = tc = 20 | |
ax = ay = 15 | |
xv = yv = 0 | |
trail = [] |
This file contains 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
/* | |
Original Code Credits: Chris DeLeon of HomeTeam GameDev | |
Modified by: Yakko Majuri | |
*/ | |
'use strict' | |
let canvas, ctx; | |
window.onload = function () { |
This file contains 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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Brython Snake</title> | |
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/brython@3.8.9/brython.min.js"> | |
</script> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous"> |
This file contains 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
proc fibonacci(n: int): int = | |
if n <= 1: | |
return n | |
return fibonacci(n-1) + fibonacci(n-2) | |
echo(fibonacci(40)) |
This file contains 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
#include <stdio.h> | |
int fibonacci(int n) { | |
if (n <= 1) { | |
return n; | |
} | |
return fibonacci(n-1) + fibonacci(n-2); | |
} | |
int main(void) { |
This file contains 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
def fibonacci(n): | |
if n <= 1: | |
return n | |
return fibonacci(n-1) + fibonacci(n-2) | |
print(fibonacci(40)) |
This file contains 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
#include <stdio.h> | |
int fibonacci(int n) { | |
if (n <= 1) { | |
return n; | |
} | |
return fibonacci(n-1) + fibonacci(n-2); | |
} | |
int main(void) { |
This file contains 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
import strformat | |
# Example taken from the Nim Website: https://nim-lang.org/ | |
type | |
Person = object | |
name: string | |
age: Natural # Ensures the age is positive | |
let people = [ |
This file contains 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
evens = [i for i in range(100) if i % 2 == 0] | |
squares = [i**2 for i in evens] | |
pairs = [(x,y) for x in range(100) for y in range(100)] | |
squarepairs = [(i, i**2) for i in range(100) if i % 2 == 0] |
This file contains 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
x, y, z = (4, 5, 6) | |
x, *xs = [1, 2, 3, 4] | |
x, y = 4, 5 |