A very poor use of time.
- Download
wikiweb.rb - Ruby 3.2.1 required (or something reasonably recent)
- Requires nokogiri (
gem install nokogiri)
| (* Data structures *) | |
| type trsns = (int * int) list (* (next * value) list *) | |
| type state = trsns * bool (* trsns * success *) | |
| type dfa = state list * int (* state list * start *) | |
| (* Simulation *) | |
| let exec dfa input = | |
| let rec step states ptr = function (* match input *) | |
| | [] -> | |
| let (_, s) = List.nth states ptr in |
| //download dictionary from https://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict.0.7a | |
| //dictionary format: ['RHYME', 'R AY1 M'] | |
| const rhymeDict = []; | |
| //despite the size of the file, this parses reasonably quickly | |
| function populateRhymeDict() { | |
| fetch('cmudict.0.7a.txt') | |
| .then(response => response.text()) | |
| .then(data => { |
| //ray_engine rs | |
| //requires sdl2 crate | |
| extern crate sdl2; | |
| use sdl2::pixels::Color; | |
| use sdl2::event::Event; | |
| use sdl2::keyboard::Keycode; | |
| use sdl2::rect::Point; | |
| use sdl2::rect::Rect; |
| public static bool detectCollision(Rectangle rect1, Rectangle rect2) | |
| { | |
| if (rect1.X < (rect2.X + rect2.Width) && | |
| (rect1.X + rect1.Width) > rect2.X && | |
| rect1.Y < (rect2.Y + rect2.Height) && | |
| (rect1.Height + rect1.Y) > rect2.Y) | |
| return true; | |
| else | |
| return false; | |
| } |
| public static int[][] rooms = new int[100][100]; | |
| public static void generate() | |
| { | |
| Random rndgen = new Random(); | |
| for(int i = 0; i <= 99; i++) | |
| { | |
| for(int j = 0; j <= 99; j++) |
| package com.bitbit.minild59.codes.main; | |
| import java.awt.image.BufferedImage; | |
| import java.io.IOException; | |
| import java.net.URL; | |
| import javax.imageio.ImageIO; | |
| public class LoadSprites | |
| { |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>codewread</title> | |
| <script src="codemirror-4.10/lib/codemirror.js"></script> | |
| <link rel="stylesheet" href="codemirror-4.10/lib/codemirror.css"> | |
| <script src="codemirror-4.10/mode/javascript/javascript.js"></script> | |
| <style> | |
| #comment | |
| { |
| //Maybe use Bitmap | |
| private static Image[] frameArray; | |
| public static Image active_frame; | |
| public static int active_frame_number; | |
| public sprite(Image[] frame_array) | |
| { | |
| frameArray = frame_array; | |
| active_frame_number = 0 | |
| active_frame = frameArray[active_frame_number]; |
| //Assumed this was a console app | |
| readAString() | |
| { | |
| Console.WriteLine("Type in a word and BE AMAZED!"); | |
| string input = Console.ReadLine; | |
| Console.WriteLine(Convert.ToString(countVowels(input)) + " vowels. Now you know!"); | |
| Console.ReadKey(); | |
| //Not sure how isVowel fits in here but you get the idea | |
| } |