diff --git a/2025/ruby/Gemfile b/2025/ruby/Gemfile
new file mode 100644
index 0000000..826a354
--- /dev/null
+++ b/2025/ruby/Gemfile
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+source "https://rubygems.org"
+
+gem "z3"
diff --git a/2025/ruby/Gemfile.lock b/2025/ruby/Gemfile.lock
new file mode 100644
index 0000000..5e00e53
--- /dev/null
+++ b/2025/ruby/Gemfile.lock
@@ -0,0 +1,35 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ ffi (1.17.2)
+ ffi (1.17.2-aarch64-linux-gnu)
+ ffi (1.17.2-aarch64-linux-musl)
+ ffi (1.17.2-arm-linux-gnu)
+ ffi (1.17.2-arm-linux-musl)
+ ffi (1.17.2-arm64-darwin)
+ ffi (1.17.2-x86-linux-gnu)
+ ffi (1.17.2-x86-linux-musl)
+ ffi (1.17.2-x86_64-darwin)
+ ffi (1.17.2-x86_64-linux-gnu)
+ ffi (1.17.2-x86_64-linux-musl)
+ z3 (0.0.20251017)
+ ffi (~> 1.17)
+
+PLATFORMS
+ aarch64-linux-gnu
+ aarch64-linux-musl
+ arm-linux-gnu
+ arm-linux-musl
+ arm64-darwin
+ ruby
+ x86-linux-gnu
+ x86-linux-musl
+ x86_64-darwin
+ x86_64-linux-gnu
+ x86_64-linux-musl
+
+DEPENDENCIES
+ z3
+
+BUNDLED WITH
+ 2.6.9
diff --git a/2025/ruby/day_10.rb b/2025/ruby/day_10.rb
new file mode 100644
index 0000000..c2af2d8
--- /dev/null
+++ b/2025/ruby/day_10.rb
@@ -0,0 +1,54 @@
+require "z3"
+
+Machine = Data.define(:lights, :schematics, :joltage) do
+ def configure_lights
+ schematics = self.schematics.map { it.inject(0) {|n,i| n + 2**i } }
+ (1..).find {|n|
+ schematics.repeated_combination(n).any? {|presses|
+ presses.inject(0) {|lights, i| lights ^ i } == lights
+ }
+ }
+ end
+
+ def configure_joltage
+ solver = Z3::Optimize.new
+
+ schematics = self.schematics.map.with_index { [_1, Z3.Int("n#{_2}")] }
+
+ solver.minimize(schematics.map(&:last).sum)
+
+ schematics.each do |_, v|
+ solver.assert(v >= 0)
+ end
+
+ joltage.each.with_index do |level, i|
+ solver.assert(
+ schematics.filter_map {|s,v| s.include?(i) && v }.inject(:+) == level
+ )
+ end
+
+ fail unless solver.satisfiable?
+ solver.model.to_h.values.sum(&:to_i)
+ end
+end
+
+machines = DATA.read.lines.map {|line|
+ lights, *schematics, joltage = line.split(/\s+/)
+
+ lights = lights.scan(/[.#]/).map {
+ case it
+ when ?. then 0
+ when ?# then 1
+ else fail
+ end
+ }.join.reverse.to_i(2)
+ schematics = schematics.map { it.scan(/\d+/).map(&:to_i) }
+ joltage = joltage.scan(/\d+/).map(&:to_i)
+
+ Machine.new(lights, schematics, joltage)
+}
+
+pp machines.map(&:configure_lights).sum
+pp machines.map(&:configure_joltage).sum
+
+__END__