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> | |
#include <stdlib.h> | |
#include <string.h> | |
static void name_prompt( char *buffer, size_t len ); | |
int main( void ) | |
{ | |
char name[15]; |
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> | |
#include <stdlib.h> | |
#include <string.h> | |
char name[15]; | |
static void name_prompt( char *buffer, size_t len ); | |
static void intro(); | |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#ifdef WIN32 | |
#include <windows.h> | |
#else | |
// Unix Stuff | |
#endif | |
void pause( int time ) |
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
#!/usr/bin/env ruby | |
=begin | |
> An interactive novel | |
> This program parses formatted text files and turns them into an interactive | |
> novel. Currently, the text files support two types of lines: display lines, or | |
> lines beginning with a greater than sign. Those lines will be printed out to | |
> the console. This program also supports prompt lines. These lines will take | |
> user input and store it in a variable. All other lines are ignored. This file | |
> can be run as an interactive novel. For completeness, please enter your name |
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
#!/usr/bin/env ruby | |
=begin | |
> An interactive novel | |
> This program parses formatted text files and turns them into an interactive | |
> novel. Currently, the text files support two types of lines: display lines, or | |
> lines beginning with a greater than sign. Those lines will be printed out to | |
> the console. This program also supports prompt lines. These lines will take | |
> user input and store it in a variable. All other lines are ignored. This file | |
> can be run as an interactive novel. For completeness, please enter your name |
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
module Main (main) where | |
import System (getArgs) | |
import System.IO (hFlush, stdout) | |
-- Runs a novel from a file | |
runNovel :: String -> IO [()] | |
runNovel filename = readFile filename >>= (mapM runLine) | |
. (filter (\x -> not (isBlank x))) |
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 "WPILib.h" | |
#include "nr/diag/diagnostics_center.h" | |
#include "nr/diag/observable_wpi.h" | |
Jaguar motorA( 1 ); | |
nr::diag::diagnostics_center& diagnostics = | |
nr::diag::diagnostics_center::get_shared_instance(); | |
diagnostics.register_device( motorA ); |
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 roll expression | |
return [0] if (/^(?<count>\d+)d(?<sides>\d+)(?:s(?<drop>\d+))?$/i =~ expression ).nil? | |
Array.new( count.to_i, nil ). | |
map { (Random.rand sides.to_i) + 1 }. | |
sort.reverse. | |
take( count.to_i - drop.to_i ) | |
end | |
expr = "(#{ARGV.join ' '})"; last = '' |
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
# Creates an element based on a selector. | |
# Currently only works for tag, id, and class. | |
$.fn.create = (selector) -> | |
# Process the selector string if necessary | |
if typeof selector is 'string' | |
# Convenience | |
class Selector |
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
## | |
## Slightly nicer .bashrc | |
## Makes pretty colors and stuff | |
## | |
## Set $PATH, which tells the computer where to search for commands | |
export PATH="$PATH:/usr/sbin:/sbin:/bin:/usr/bin:/etc:/usr/ucb:/usr/local/bin:/usr/local/local_dfs/bin:/usr/bin/X11:/usr/local/sas" | |
## Where to search for manual pages | |
export MANPATH="/usr/share/man:/usr/local/man:/usr/local/local_dfs/man" |
OlderNewer