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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using NAudio.Midi; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// typical args : |
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
using NUnit.Framework; | |
[TestFixture] | |
public class RomanNumeralTest | |
{ | |
[Test] | |
public void Zero_Returns_Empty_String() | |
{ | |
Assert.AreEqual(string.Empty, RomanNumerals.ToRoman(0)); |
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
# Tiny Asteroids with exploding ship for Microbit | |
from microbit import * | |
import random | |
# board dimensions | |
pixel_width, pixel_height = 4, 4 | |
Frame_Rate_In_Milliseconds = 500 | |
# general game functions |
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
Function Replace-ConfigSecrets | |
{ | |
[CmdletBinding()] | |
Param ( | |
[string]$ConfigPath | |
) | |
$Replacements = @{ | |
'##MY_CREDENTIALS_USERNAME##' = 'This is not my user 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
from microbit import * | |
sleep_time = 200 | |
warning_time = 5000 | |
class Pinger: | |
def __init__(self): | |
self.direction = 1 | |
self.x = 2 |
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
from microbit import * | |
import speech | |
note_name_to_value = { | |
"c3" : "58", | |
"cs3" : "55", | |
"d3" : "52", | |
"ds3" : "49", | |
"e3" : "46", | |
"f3" : "44", |
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
// using the default handler sends requests to | |
// the interwebs... | |
HttpClient httpClient = new HttpClient(); | |
var response = httpClient.GetAsync(url).Result; |
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
# https://en.wikipedia.org/wiki/Langton's_ant | |
from microbit import * | |
import random | |
def create_new_ant(): | |
return [random.randint(0, 4), random.randint(0, 4)] # start at a random place on the board | |
def pick_direction(compass_points): | |
return random.choice(compass_points) |
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
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<UsingTask TaskName="SetTFSVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> | |
<ParameterGroup> | |
<Name ParameterType="System.String" Required="true" /> | |
<Value ParameterType="System.String" Required="true" /> | |
</ParameterGroup> | |
<!-- https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md --> | |
<Task> |
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
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> | |
<ParameterGroup> | |
<Name ParameterType="System.String" Required="true" /> | |
<Value ParameterType="System.String" Required="true" /> | |
</ParameterGroup> | |
<Task> | |
<Using Namespace="System" /> |
NewerOlder