---
title: "gambit: Chess engine in Scala 3 | VulCode"
description: "gambit is a chess engine in Scala 3, that is a program that picks the move to play for a given position on the board."
url: "https://vulcode.com/en/portfolio/other/gambit"
lang: "en"
---

[Other](https://vulcode.com/en/portfolio/other)

# gambit

Chess engine in Scala 3

A chess engine written in Scala 3 and built with the scala-cli tool. It generates moves, evaluates positions and picks the move to play on its own.

## About the project

gambit is a chess engine in Scala 3, that is a program that picks the move to play for a given position on the board. It has three parts: a move generator that lists the legal moves, a position evaluation that gives an arrangement of pieces a numeric value, and a search that examines successive lines and points to the best one. Together they make up everything needed to play chess. The project is built with scala-cli, a command-line tool for compiling and running Scala code.

## The challenge

A chess engine is three hard things at once: flawless move generation, meaningful position evaluation and a search that picks a good move in reasonable time. In gambit all three had to work together for the engine to play at all.

## What we did

- A generator of moves that follow the rules of chess

- A position evaluation function

- A search that picks a move in reasonable time

- Scala 3 code built with scala-cli

## Related projects

- [**warren** A roguelike game written in Lua and played in the terminal. Every run is generated afresh, and part of your progress stays with you between runs.](https://vulcode.com/en/portfolio/other/warren)

- [**kite** A Scheme interpreter written in Swift, with an interactive REPL console and a runner for .scm files. It supports continuations, macros and exact arithmetic on arbitrarily large numbers.](https://vulcode.com/en/portfolio/other/kite)

- [**cinnamon-tweaks** Two small Python programs with GTK windows for the Cinnamon desktop: one for custom keyboard shortcuts, one for panel settings. For people who change these settings often and do not want to dig for them in Settings.](https://vulcode.com/en/portfolio/other/cinnamon-tweaks)

## Describe your project.

A free quote comes back within an hour during working hours.

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)

## Tell us what you want to build.

A free quote comes back within an hour during working hours. You talk to the person who writes the code.

[Free quote](https://vulcode.com/en/quote) [Free consultation](https://vulcode.com/en/consultation)

- [hello@vulcode.com](mailto:hello@vulcode.com)

- [+48 576 043 920](tel:+48576043920)

- [discord.gg/vulcode](https://discord.gg/vulcode)
