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 <iostream> | |
#include <string> | |
int main() { | |
std::string word; | |
int i; | |
std::cout << "enter 3 words: "; | |
for ( i = 0; i < 3; ++i ) { |
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
#!/bin/env python | |
""" | |
trailblazer: a narrative programming tool | |
(c) copyright 2005 sabren enterprises inc. all rights reserved. | |
""" | |
""" | |
<h1>the trailblazer experiment</h1> | |
Narrative programming is like literate programming with version |
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 Substance; | |
class Grid | |
{ | |
public var data : Array<Array<Int>>; | |
public var width:Int; | |
public var depth:Int; | |
public function new (proto, width:Int=-1, depth:Int=-1) | |
{ |
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
// Copyright (c) 2011 Michal J Wallace and Sean D. Siem | |
// See the file license.txt for copying permission. | |
// $Id: Grid.cs 993 2012-10-15 19:56:23Z mwallace $ | |
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using JsonFx.Json; | |
namespace AlchementrixCore |
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 <iostream> | |
using namespace std; | |
void stepIntoMe() | |
{ | |
cout << "inside the subroutine" << endl; | |
} | |
int main() |
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> | |
// program to challenge the assertion that | |
// c disallows switching on characters. | |
int main() { | |
char ch; | |
for (ch = 'a'; ch < 'z'; ch++) { | |
switch(ch) { | |
case 't': printf("t[angentstorm]"); break; |
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
// when asm( ) encounters a word that starts with punctuation, | |
// it will not try to compile a call to that word, but will instead | |
// look up the word's definition in the "macro" vocabulary, and | |
// execute the macro immediately. | |
// | |
// The macros are written in javascript. | |
// semicolon. in forth this would issue a 'return' instruction, | |
// but in b4, it's used as punctuation. In the default context, | |
// it doesn't do anything, but it can be used to break long |
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
[[a[nd | |
|rray | |
|s | |
|sm] | |
|b[egin] | |
|c[ase | |
|lass | |
|onst[ | |
|ructor]] | |
|d[e[structor |
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
# B4 - a bootstrap assembler for Ngaro/RetroVM | |
# -------------------------------------------------------------- | |
# This is a tiny, pure-binary forth interpreter. Input consists | |
# of 4-byte sequences, which can either be ngaro instructions or | |
# space-terminated strings. | |
# Data area. | |
# -------------------------------------------------------------- | |
# When ngaro boots up, the instruction pointer is set to zero, which |
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
# -*- coding: utf-8 -*- | |
""" | |
colliding disks | |
""" | |
import numpy as np | |
import numpy.random as nr | |
n = 10 # number of discs | |
w = 100 # width |