Skip to content

Instantly share code, notes, and snippets.

@sursir
Last active August 29, 2015 14:15
Show Gist options
  • Save sursir/c4c2887e7a835cdc01ae to your computer and use it in GitHub Desktop.
Save sursir/c4c2887e7a835cdc01ae to your computer and use it in GitHub Desktop.
test
#include <stdio.h>
int main(void)
{
printf("hello world!");
return 0;
}
#test
int main(){
print('hello, world');
return 0;
}
// import 'dart:math' show Random; // Import a class from a library.
// void main() { // The app starts executing here.
// print(new Die(n: 12).roll()); // Print a new object's value. Chain method calls.
// }
// class Die { // Define a class.
// static Random shaker = new Random(); // Define a class variable.
// int sides, value; // Define instance variables.
// String toString() => '$value'; // Define a method using shorthand syntax.
// Die({int n: 6}) { // Define a constructor.
// if (4 <= n && n <= 20) {
// sides = n;
// } else {
// throw new ArgumentError(/* */); // Support for errors and exceptions.
// }
// }
// int roll() { // Define an instance method.
// return value = shaker.nextInt(sides) + 1; // Get a random number.
// }
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment