Skip to content

Instantly share code, notes, and snippets.

View iamPedroVictor's full-sized avatar

Pedro Victor Ferreira iamPedroVictor

View GitHub Profile
const http = require('http');
const url = require('url');
const head = {
'Content-Type': 'text/html;charset=utf-8',
};
const HtmlHead = response => {
response.write('<head>');
response.write("<title>Webservice - Fametro</title>");
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
//Credits to dwilches - SerialCommUnity
//Source >> https://github.com/DWilches/SerialCommUnity
public class MessageListener : MonoBehaviour {
string expanded = grammar.Flatten("#Test#"); //Aqui passa a regra que vai ser chamada para gerar a string
//assumindo que a gramatica tenha a regra chamada "Test"
print(expanded); //Mostrando a string gerada.
Grammar grammar = new Grammar(); //Usando o construtor publico para poder gerar o objeto.
//Criar as regras dentro do objeto grammar.
grammar.PushRules("Test", new string[] { "Hello, #name#!" });
grammar.PushRules("name", new string[] { "Max", "world", "Pedro", "Henrique" });