Skip to content

Instantly share code, notes, and snippets.

use "itertools"
use "promises"
use "collections"
use "debug"
class val ComputationResult
let input : USize
let output : USize
new create(input' : USize, output' : USize) =>
use "lib:SDL2"
use "lib:SDL2main"
use "time"
use "debug"
use @SDL_Init[I32](flags: U32)
use @SDL_CreateWindow[Pointer[_SDLWindow val] ref](title: Pointer[U8] tag, x: I32, y: I32, w: I32, h: I32, flags: U32)
use @SDL_CreateRenderer[Pointer[_SDLRenderer val] ref](window: Pointer[_SDLWindow val] box, index: I32, flags: U32)
use @SDL_DestroyRenderer[None](renderer: Pointer[_SDLRenderer val] box)
use @SDL_DestroyWindow[None](window: Pointer[_SDLWindow val] box)
try
{
var originalSourceCode = document.getElementsByClassName("pony-full-source")[0];
var preElem = document.createElement("pre");
var codeElem = document.createElement("code");
codeElem.className = 'pony';
preElem.append(codeElem);
originalSourceCode.parentNode.append(preElem);
codeElem.innerHTML = originalSourceCode.innerHTML;
pre {
position: relative;
margin-bottom: 24px;
border-radius: 3px;
border: 1px solid #C3CCD0;
background: #FFF;
overflow: hidden;
}
code {
try
{
$('pre code').each(function(){
var lines = $(this).text().split('\n').length - 1;
var numbering = $('<code class="code-line-numbers"></code>').addClass('pre-numbering');
$(this)
.addClass('has-numbering')
.parent()
.append(numbering);
class Truc
{
public machin()
{
for (int j = 0; j < _height; j++)
{
for (int i = 0; i < _width; i++)
{
var swap = j * _width * 3 + (_width * 3 - 3 - i);
for (int channel = 0; channel < 3; channel++)
// Example program
#include <iostream>
#include <string>
class type_de_base {};
class type_derive : public type_de_base {};
void fonctionALaCon(type_de_base& a)
{
> mkdocs serve
INFO - Building documentation...
WARNING - The theme 'ponylang' does not appear to have a configuration file. Please upgrade to a current version of the the
INFO - Cleaning site directory
ERROR - Error building page index.md
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\
extern crate gluon;
use gluon::*;
use gluon::vm::api::IO;
use std::fs::File;
use std::io::prelude::*;
use std::env;
> cargo run gluon_src/game_24.glu
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Running `target\debug\gluon.exe gluon_src/game_24.glu`
Error during script execution: Multiple(Errors { errors: [Macro(Spanned { span: Span { start: 1726, end: 1736, expansion_id: ExpansionId(0) }, value: String("Could not find module \'std.random\'") }), Typecheck(InFile { source_name: "main", error: Errors { errors: [SourceContext { line: " do a = gen_digit\r", error: Spanned { span: Span { start: Location { line: 137, column: 11, absolute: 5129 }, end: Location { line: 137, column: 20, absolute: 5138 }, expansion_id: ExpansionId(0) }, value: Help { error: Unification(App(Alias(AliasRef { index: 0, group: [AliasData { name: 0x1c20061eff0:IO, typ: Forall([Generic { id: 0x1c20061ef90:a, kind: Type }], Opaque, None) }] }), [Builtin(Int)]), Forall([Generic { id: 0x1c200650b30:a, kind: Type }], Generic(Generic { id: 0x1c200650b30:a, kind: Type }), None), [TypeMismatch(App(Alias(AliasRef { index: 0, group: [