Commit c35174a0 authored by Nicaudie Charlotte's avatar Nicaudie Charlotte

Added turtle2js file

parent 2a030e18
let program2c out (p : MJ.program) : unit =
fprintf out
"<!DOCTYPE html>\n\
<meta charset=\"utf-8\">\n\
<style type=\"text/css\">\n\
html, body {\n\
margin: 0;\n\
html {\n\
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\n\
height: 100%;\n\
body {\n\
overflow: hidden;\n\
height: inherit;\n\
h1 {\n\
font-size: 2rem;\n\
letter-spacing: -1px;\n\
position: absolute;\n\
margin: 0;\n\
top: -4px;\n\
right: 5px;\n\
color: transparent;\n\
text-shadow: 0 0 4px white;\n\
// Canvas setup\n\
const canvas = document.querySelector('canvas');\n\
const ctx = canvas.getContext('2d');\n\
const width = canvas.width = window.innerWidth;\n\
const height = canvas.height = window.innerHeight;\n\
// Function to generate a random number\n\
function random(min,max) {\n\
const num = Math.floor(Math.random()*(max-min)) + min;\n\
return num;\n\
// Variables\n\
// Methods\n\
// Animation\n\
function loop() {\n\
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment