Skip to content

Mercerenies/eulers-melting-pot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Euler's Melting Pot

This is a Project Euler attempt. The catch is that every challenge will be completed in a different programming language.

Euler's Melting Pot is also being run as an educational YouTube series, where I talk about the code I've written here. See https://www.youtube.com/playlist?list=PL1ltQrTP1szcCAD-Jm-6eQdV_zhnm3oNq

Languages Used

Full details of the various solutions are listed below, but for the sake of easy reference, here is an alphabetized list of the languages that have been used in these challenges so far.

  • *><>
  • ///
  • 05AB1E
  • 1.1
  • 11l
  • 42
  • ><>
  • ><>\\.:.
  • Actually
  • Ada
  • Agda
  • AGSPL
  • ALGOL 68
  • Alice
  • Anti-Array
  • APL
  • Arc
  • ArkScript
  • AssemblyScript
  • AutoHotkey
  • AWK
  • Aya
  • Batch
  • bc
  • BeanShell
  • Beeswax
  • Befalse
  • Befreak
  • Befunge
  • Befunk
  • Brachylog
  • Brainf**k
  • Brat
  • Broccoli
  • Burlesque
  • Bussin
  • C#
  • Chef
  • CIL
  • CJam
  • COBOL
  • Coconut
  • Comefrom0x10
  • COMPLEX
  • 🆒
  • Csh
  • Cubix
  • Cyclone
  • D
  • Dafny
  • Dhall
  • Dictu
  • Dip
  • Dogescript
  • Dry
  • Dylan
  • Earl Grey
  • ed
  • Eiffel
  • ELisp
  • Elixir
  • Emoji
  • Emoticon
  • Emotinomicon
  • Enchilada
  • Erlang
  • 𝔼𝕊𝕄𝕚𝕟
  • Factor
  • Factorio
  • FALSE
  • Fennel
  • FiM++
  • Fish
  • Folders
  • Forth
  • Fortran
  • Fourier
  • Funciton
  • Game Builder Garage
  • Genie
  • Gibberish
  • Glava
  • Gleam
  • GML
  • GNU Octave
  • Go
  • Golfscript
  • Grocery List
  • Gwion
  • Hanabi
  • Hexagony
  • Hy
  • Hyperscript
  • i
  • Icon
  • IntercalScript
  • Io
  • Ioke
  • J
  • Japt
  • Jasmin
  • Javagony
  • Javagrid
  • Jelly
  • Joy
  • JSF**k
  • Julia
  • JustBASIC
  • K
  • Kitten
  • Labyrinth
  • LaTeX
  • Lean
  • LilyPond
  • LLVM IR
  • m4
  • Make
  • MagiStack
  • MASM
  • Math++
  • MATL
  • Microsoft Excel
  • Minecraft
  • Minus
  • MontiLang
  • MoonScript
  • Mouse-2002
  • NASM
  • naz
  • Nemerle
  • Nial
  • Nim
  • Nit
  • Oasis
  • Oberon-07
  • Objective-C
  • OCaml
  • Odin
  • Oxide
  • Pascal
  • Parrot IR
  • PASM
  • Perchance
  • Picat
  • Pickle
  • Piet
  • Pike
  • Pikt
  • Pip
  • Pizza
  • Pony
  • Potassco
  • Prolog
  • Pyf**ck
  • Pyth
  • Pyramid Scheme
  • QBASIC
  • Rebol
  • Rockstar
  • Roy
  • Rust
  • Scratch
  • sed
  • Seriously
  • Shakespeare
  • Skib-Lang
  • Smalltalk
  • SNOBOL
  • Snowman
  • Standard ML
  • Stuck
  • SuperCollider
  • Swift
  • Taxi
  • Tcl
  • Tome
  • Tovie
  • TRANSCRIPT
  • TypeScript
  • V
  • Vala
  • Vale
  • VBA
  • Verilog
  • Visual Basic .NET
  • WebAssembly
  • Wenyan
  • Whirl
  • Whitespace
  • Wren
  • Wyvern
  • X10
  • XSLT
  • Z
  • Zig
  • zkl
  • Zsh

Completed Challenges

Euler 1

Euler 2

Euler 3

Euler 4

  • File: problem4.bat
  • Language: Batch
  • Compiler / Interpreter: Windows CMD
  • Notes: This one is really slow. Interestingly, it seems to be not the palindrome check but the multiplication that slows it down.

Euler 5

Euler 6

Euler 7

Euler 8

Euler 9

Euler 10

Euler 11

  • File: problem11.s
  • Language: NASM
  • Compiler / Interpreter: NASM + GCC Linker
  • Notes: 64-bit architectures, only. Uses Windows calling convention; to run on Linux, call puts with RDI rather than RCX.

Euler 12

Euler 13

  • File: problem13.sed
  • Language: sed
  • Compiler / Interpreter: GNU sed
  • Notes: Other sed implementations may not work. Must supply ./files/problem13.txt as input.

Euler 14

Euler 15

  • File: problem15.pl
  • Language: Prolog
  • Compiler / Interpreter: SWI Prolog
  • Notes: Uses some SWI-specific database features; may not work in other Prolog implementations.

Euler 16

Euler 17

Euler 18

  • File: problem18.mk
  • Language: Make
  • Compiler / Interpreter: GNU Make
  • Notes: Other Make implementations may not work.

Euler 19

Euler 20

Euler 21

Euler 22

Euler 23

Euler 24

  • File: problem24.sh
  • Language: Csh
  • Compiler / Interpreter: Tcsh
  • Notes: Uses a rather unusual algorithm to manually generate each digit.

Euler 25

  • File: problem25.png
  • Language: Piet
  • Compiler / Interpreter: rpiet
  • Notes: Piet interpreter must have bignum integers, not fixed size.

Euler 26

  • File: problem26.sh
  • Language: Zsh
  • Compiler / Interpreter: Zsh
  • Notes: (None)

Euler 27

Euler 28

  • File: problem28.bf
  • Language: Befunge
  • Compiler / Interpreter: quirkster.com
  • Notes: The immediate shift on the first row is necessary; the first row is used for storage in this program.

Euler 29

  • File: problem29.srs
  • Language: Seriously
  • Compiler / Interpreter: TIO Nexus
  • Notes: The seemingly pointless union with the empty list at the end serves to remove duplicates.

Euler 30

  • File: problem30.stk
  • Language: Stuck
  • Compiler / Interpreter: The official interpreter
  • Notes: The interpreter seems to require some minor modification to work with Unicode on some systems, a somewhat slow solution.

Euler 31

Euler 32

Euler 33

  • File: problem33.xsl
  • Language: XSLT
  • Compiler / Interpreter: Mozilla Firefox
  • Notes: Load ./files/p33.xml to run the XSLT code; requires disabling security.fileuri.strict_origin_policy on Firefox due to local system security constraints.

Euler 34

Euler 35

Euler 36

Euler 37

Euler 38

Euler 39

Euler 40

  • File: problem40.tex
  • Language: LaTeX
  • Compiler / Interpreter: MiKTeX
  • Notes: May have to increase the memory limit, depending on OS.

Euler 41

Euler 42

Euler 43

Euler 44

Euler 45

Euler 46

Euler 47

Euler 48

Euler 49

Euler 50

Euler 51

Euler 52

Euler 53

Euler 54

Euler 55

Euler 56

  • File: problem56.bc
  • Language: bc
  • Compiler / Interpreter: GNU bc
  • Notes: (None)

Euler 57

Euler 58

Euler 59

Euler 60

Euler 61

Euler 62

Euler 63

Euler 64

  • File: problem64.m4
  • Language: m4
  • Compiler / Interpreter: GNU m4
  • Notes: Other m4 implementations may not work.

Euler 65

Euler 66

Euler 67

Euler 68

Euler 69

Euler 70

Euler 71

Euler 72

Euler 73

Euler 74

Euler 75

Euler 76

Euler 77

Euler 78

Euler 79

  • File: problem79.ed
  • Language: ed
  • Compiler / Interpreter: GNU ed 1.18
  • Notes: Supply ./files/0079_keylog.txt as argument and problem79.ed as piped standard input.

Euler 80

Euler 81

Euler 82

  • File: problem82.awk
  • Language: AWK
  • Compiler / Interpreter: mawk
  • Notes: Pass ./files/p082_matrix.txt as input.

Euler 83

Euler 84

Euler 85

Euler 86

Euler 87

Euler 88

Euler 89

Euler 90

Euler 91

Euler 92

Euler 93

  • File: problem93.gs
  • Language: Genie
  • Compiler / Interpreter: valac
  • Notes: Ignore the lengthy list of pointer cast warnings when compiling.

Euler 94

Euler 95

Euler 96

Euler 97

Euler 98

Euler 99

Euler 100

Euler 101

Euler 102

Euler 103

Euler 104

Euler 105

Euler 106

Euler 107

Euler 108

Euler 109

Euler 110

Euler 111

Euler 112

Euler 113

Euler 114

Euler 115

Euler 116

Euler 117

Euler 118

Euler 119

Euler 120

Euler 121

Euler 122

Euler 123

Euler 124

Euler 125

Euler 126

Euler 127

Euler 128

Euler 129

Euler 130

Euler 131

Euler 132

Euler 133

Euler 134

Euler 135

  • File: problem135.tovie
  • Language: Tovie
  • Compiler / Interpreter: Tovie v_03
  • Notes: A somewhat slow solution; must be run using the Python transpiler (./tovie -f python ./problem135.tovie), as the default compiler's malloc implementation is broken.

Euler 136

Euler 137

Euler 138

Euler 139

Euler 140

Euler 141

Euler 142

Euler 143

Euler 144

Euler 145

Euler 146

Euler 147

Euler 148

Euler 149

Euler 150

Euler 151

Euler 152

Euler 153

Euler 154

Euler 155

Euler 156

Euler 157

Euler 158

Euler 159

Euler 160

Euler 161

Euler 162

Euler 163

Euler 164

Euler 165

Euler 166

Euler 167

Euler 168

Euler 169

Euler 170

Euler 171

Euler 172

Euler 173

Euler 174

Euler 175

Euler 176

Euler 177

Euler 178

Euler 179

Euler 180

Euler 181

Euler 182

Euler 183

Euler 184

Euler 185

  • File: problem185.lp
  • Language: Potassco
  • Compiler / Interpreter: clingo
  • Notes: The answer outputs correct(N, X), where X is the Nth digit in the result.

Euler 186

Euler 187

  • File: problem187.ms
  • Language: Minus
  • Compiler / Interpreter: iminus.c
  • Notes: A very slow solution, will need to increase the mem_size constant to compile (#define mem_size 300000000 is sufficient), code was written with the help of a Racket translator program.

Euler 188

Euler 189

Euler 190

Euler 191

Euler 192

Euler 193

Euler 194

Euler 195

Euler 196

Euler 197

Valid Languages

Mostly, I am just using common sense to determine what constitutes a "language". In particular, a language does not have to be Turing-complete in order for me to consider using it for this challenge. Here are just a few of the guidelines I am following. These are in no way permanent or binding and will change as I progress.

  • BF-derivatives and BF-clones are considered identical to Brainf**k and will not be used.
  • Lisp derivatives are considered distinct. That is, there will be a Racket, a Common Lisp, and an ELisp, which are all distinct languages.
  • Sufficiently different BASIC dialects will be considered distinct. That is, Visual BASIC, Liberty BASIC, and QBASIC are distinct languages, but Liberty BASIC and JustBASIC are one and the same.
  • The result should be in a normal, human readable form. For example, in BF it is insufficient to print the ASCII character associated with the integer result; it is required to print the result as a number. There is no specific required format, as some languages may include some garbage around the answer, so long as the answer as outputted is clear and readable. If the language is incapable of outputting a human readable value, whatever is considered acceptable output within the language will be acceptable.
  • I have written a few programming languages. At least one of them is in a usable state right now. For fairness, I will not be using any language that I myself wrote.
  • Generally speaking, interpreters and compilers are to be taken "as-is". That means that, while it is perfectly permissible to use compiler-specific extensions to a language, it is also necessary to treat any bugs in the chosen compiler as intended behavior. One minor exception to this is in the case of historical code, where minor modifications are necessary to get a language interpreter written long ago to work on a modern computer, as there are several historical languages I aim to use for this challenge.

Speed Adjectives

Some solutions are marked as "slow". Generally speaking, the following rough guidelines can be used to estimate how long it takes to run the code on a reasonably modern computer. These are, of course, very rough estimates, so take them with a grain of salt.

  • 30s or less: I will generally not denote these at all.
  • 30s to 2min: "A somewhat slow solution"
  • 2min to 10min: "A very slow solution"
  • More than 10min: "An incredibly slow solution"

Currently, the slowest solutions in this repository are:

  • Problem 179 (Whirl) in ~34 minutes
  • Problem 130 (Fourier) in ~26 minutes
  • Problem 96 (Javagony) in ~20 minutes
  • Problem 188 (Javagrid) in ~18 minutes

Currently, the slowest solution in this repository is Problem 130 (Fourier), which takes roughly 26 minutes. The second slowest is Problem 96 (Javagony), at roughly 20 minutes.

I do not have an explicit upper bound on the runtime of a correct algorithm. I will not leave code unattended overnight or for days on end, and the code written must actually terminate on a machine I have access to, not just theoretically produce correct results.

Final Notes

You'll notice that I'm not using many of the mainstream languages so far. This is not because I'm trying to make this challenge harder than it is; this is a purely strategic decision. The later Project Euler problems are more difficult, so I am saving the powerful and easy-to-use languages for them and using obscure, esoteric languages for the easier problems.

About

Project Euler but with some variety

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published