This file contains hidden or 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.IO; | |
| namespace waddy | |
| { | |
| class Program | |
| { | |
| static string GetString(byte[] arr) | |
| { | |
| return System.Text.ASCIIEncoding.ASCII.GetString(arr); |
This file contains hidden or 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
| var gameScreen = document.getElementById("gameScreen"); | |
| var context = gameScreen.getContext("2d"); | |
| context.fillStyle = "#FFFFFF"; | |
| context.font = "8px Sans-Serif"; | |
| context.fillText("Pong!", 10, 10); | |
| var ball = { | |
| x : 50, | |
| y : 50, |
This file contains hidden or 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
| export class HtmlElementFactory { | |
| // method overloading - sort off... pretty weird | |
| static CreateGeneric(elementName: string): HTMLElement; | |
| static CreateGeneric(elementName: string, elementId: string, | |
| innerHTML:string,attributes: Array<HtmlElementAttributes>) : HTMLElement; | |
| static CreateGeneric(elementName: string, elementId?: string, | |
| innerHTML?:string, attributes?: Array<HtmlElementAttributes>) : HTMLElement { | |
| var htmlElement = document.createElement(elementName); |
This file contains hidden or 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
| pub fn is_leap_year(year: i32) -> bool { | |
| (year % 4) == 0 || (year % 100 == 0 && year % 400 == 0) | |
| } |
This file contains hidden or 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
| extern crate chrono; | |
| use chrono::*; | |
| // Returns a Utc DateTime one billion seconds after start. | |
| pub fn after(start: DateTime<Utc>) -> DateTime<Utc> { | |
| start + Duration::seconds(1000000000) |
This file contains hidden or 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
| // The &'static here means the return type has a static lifetime. | |
| // This is a Rust feature that you don't need to worry about now.. | |
| pub fn hello() -> &'static str { | |
| "Hello, World!" | |
| } |
This file contains hidden or 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 System.Text; | |
| using System.Threading.Tasks; | |
| namespace LearnTreeDS | |
| { | |
| public class Node | |
| { |