Commit 48b2f308 authored by Kai Brandes's avatar Kai Brandes

added wasm solutions for 4

parent 28fff7fa
import React from "react";
import * as wasm from "adventofcode_2017";
export class Day4 extends React.Component {
constructor(props) {
this.state = {
a: null,
b: null
this.resultA = this.resultA.bind(this);
this.resultB = this.resultB.bind(this);
resultA(event) {
this.setState({a: wasm.calc_day_4_a(});
resultB(event) {
this.setState({b: wasm.calc_day_4_b(});
render() {
return (
<h1><a href="" target="_blank">Day 4</a></h1>
<textarea cols={50} rows={10} type="text" onInput={this.resultA} defaultValue={"aa bb cc dd aa\naa bb cc dd aaa\n"}/>
Result: {this.state.a}
<textarea cols={50} rows={10} type="text" onInput={this.resultB} defaultValue={"bqs bqs dbutvgf mmzb izpyud rap izpyud xlzeb mnj hjncs\ncirkjq nmjuu xtgejv gtexvj vjcmtqq unjmu\nofbh bdrsk rdrjj elaxvk jrjdr\n"}/>
Result: {this.state.b}
\ No newline at end of file
import {Day1} from './components/day1';
import {Day2} from './components/day2';
import {Day3} from './components/day3';
import {Day4} from './components/day4';
import React from "react";
import ReactDOM from "react-dom";
......@@ -9,6 +10,7 @@ export function render() {
], solutions);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment