Skip to content

Instantly share code, notes, and snippets.

View kristianpedersen's full-sized avatar

Kristian Pedersen kristianpedersen

View GitHub Profile
import clock from "../img/clock.svg"
import diaphragm from "../img/diaphragm.svg"
import money from "../img/money.svg"
import teamwork from "../img/teamwork.svg"
const cards = [
{ icon: clock, h1Text: "Efficient", pText: "So efficient!" },
{ icon: teamwork, h1Text: "Teamwork", pText: "Such teamwork" },
{ icon: diaphragm, h1Text: "Diaphragm", pText: "Diaphphgraprhagm" },
import './App.css'
import { useEffect, useState } from "react"
import axios from "axios"
// In package.json, add:
// "proxy": "http://api.wolframalpha.com/v2",
const BASE = "/query?input=pi&appid="
const APP_ID = "W766VX-QK99987KQ6"
const URL = BASE + APP_ID
@kristianpedersen
kristianpedersen / test.md
Last active September 6, 2021 19:18
JS works, Clojure logs empty list

Hi! Given a chess board position, I want to return all moves that have a distance of (x = 1 and y = 2) or (x = 2 and y = 1).

I have solved this in JavaScript, and I'm trying to implement it in Clojure, but my Clojure function just returns an empty list (). What am I missing?

Also, if you have any comments on readability or making the code more idiomatic, that's of course appreciated.

Here they are - first the JavaScript implementation, and then the Clojure one:

const originalBoard = [