I saw a railroad diagram for 'Hey Jude' on Facebook and found a railroad diagram generator, so I implemented the diagram in that.
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
def matching_positions(data, choices): | |
# Example: data="apabanan", choices="aan" | |
# Initialize a dictionary for all positions of the char's in choices | |
positions = {} | |
for c in choices: | |
positions[c] = [] | |
# Populate the dictionary | |
for k, c in enumerate(data): |
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
# Korrigerad version | |
# Ange ett tal | |
number = input("Ange ett tal mellan 1 - 100. ") | |
# Använd heltal | |
number = int(number) | |
# Räknare | |
guess = 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
package main | |
import ( | |
"fmt" | |
"golang.org/x/tour/tree" | |
) | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. |
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
// https://en.wikipedia.org/wiki/6174_(number) | |
package main | |
import ( | |
"fmt" | |
"sort" | |
"strconv" | |
) |
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
#include <stdio.h> | |
#include <malloc.h> | |
#include <string.h> | |
#define SIZE 256 | |
struct element { | |
char *key; | |
double value; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Sveriges nationaldag - dagen då invandrarna går man ur huse för att fira Sverige medan rasisterna sitter inne och tjurar och hävdar att man inte får sjunga nationalsången eller vifta med svenska flaggan. |
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
// Instead of | |
if (n == 42) | |
single_stmt; | |
// one can write | |
switch (n) | |
case 42: | |
single_stmt; | |