Skip to main content

All Questions

Filter by
Sorted by
Tagged with
4 votes
1 answer
151 views

My implementation of Clojure's assoc-in

This is my implementation of Clojure's assoc-in function. I am looking for tips on making it more idiomatic and in general, better. ...
Navarro's user avatar
  • 165
5 votes
2 answers
786 views

Parsing infix expressions in Clojure

I'm trying to teach myself Clojure by reading the Brave Clojure book online, and at the end of Chapter 7 there is an exercise to parse a mathematical expression written as a list in infix notation to ...
Eric Zhang's user avatar
2 votes
1 answer
51 views

Storing facts for logical questions

I am writing a crude artificial intelligence program. I am happy with my program's ability to file away new word in ways that will allow logic to be done on them. Before I start expanding the logic ...
Gregg Arthur Evans's user avatar
2 votes
0 answers
148 views

Computing nth roots of a number - SICP exercise 1.45

From SICP Exercise 1.45: We saw in 1.3.3 that attempting to compute square roots by naively finding a fixed point of x/y does not converge, and that this can be fixed by average damping. ...
lightning_missile's user avatar
1 vote
2 answers
11k views

Highest number in a list with Racket

I am trying to build a function to find the highest number in a list without using the built-in functions of "apply" and "max". I created the following code: ...
user avatar
1 vote
2 answers
8k views

Reverse the order of a list in Racket

I am using the SICP book. There is an exercise in which you need to create a function that will receive a list as an argument and return a list with the same elements in a reverse order. I know there ...
user avatar
5 votes
1 answer
326 views

“Guess My Number” with Racket

I am using the book "Realm of Racket" which was written by the people behind the Racket and Dr. Racket projects. It is a great book based on games, similar to the famous "Land of Lisp". The first ...
user avatar
3 votes
1 answer
474 views

Church Numerals

Here is exercise 2.6 from SICP: Exercise 2.6: In case representing pairs as procedures wasn’t mind-boggling enough, consider that, in a language that can manipulate procedures, we can get by ...
lightning_missile's user avatar
8 votes
1 answer
883 views

"Curious Numbers" (HackerRank PE 34)

I was inspired by a certain recent question to try my hand at this challenge: Project Euler #34: Digit factorials \$19!\$ is a curious number, as \$1!+9!=1+362880=362881\$ is divisible by \$19\$...
Phrancis's user avatar
  • 20.4k
8 votes
2 answers
297 views

Compiler for a minimal LISP dialect to run on the Java Virtual Machine

As the title states, this is a compiler written in C with a ruby build script that translates a minimal LISP dialect and spits out an executable jar file. I designed this LISP dialect and named it ...
user avatar
3 votes
1 answer
108 views

Golden Section Search in Lisp

I implemented the golden section search algorithm recursively in Lisp. My code is: ...
Paulo Mendes's user avatar
7 votes
2 answers
327 views

Getting functional Common Lisp code for handling state in a SDL animation

The following code draws a red rectangle bouncing between the borders of a white display. I'm not particularly happy with the update function: ...
barerd's user avatar
  • 225
13 votes
1 answer
2k views

Clojure Neural Network

After reading this article about Neural Networks I was inspired to write my own implementation that allows for more than one hidden layer. I am interested in how to make this code more idiomatic - ...
matio2matio's user avatar
50 votes
1 answer
2k views

Connect Four AI (Minimax) in Clojure

I wrote a Connect Four game including a AI in Clojure and since I'm rather new to Clojure, some review would be highly appreciated. It can include everything, coding style, simplifications, etc. But ...
naeg's user avatar
  • 641
5 votes
1 answer
188 views

Pile shuffle of a vector

My goal is to simulate a Pile shuffle of a vector. It takes 2 optional arguments for the number of piles to use and how many times to perform the shuffle. As this is my first attempt at clojure code, ...
jondavidjohn's user avatar

15 30 50 per page