writing.exchange is one of the many independent Mastodon servers you can use to participate in the fediverse.
A small, intentional community for poets, authors, and every kind of writer.

Administered by:

Server stats:

321
active users

#csp

0 posts0 participants0 posts today
Replied in thread

@joshg Took a few minutes to type in, but it’s not egregious, the logic is straightforward and can be solved by hand easily. But it’s more instructive this way:

include "alldifferent.mzn";

% Two lists of ints between 1 and 5, both inclusive
% One we'll use for the indices of the matrix cell coordinates, and the other for cell values.
set of int: COORD = 1..5;
set of int: VALUE = 1..5;

% Define a matrix, which is a 2-dimensional array with indices for its cells
% defined by COORD, so between 1 and 5, where each matrix cell
% takes any value of those defined in the list VALUE:
array[COORD,COORD] of var VALUE: v;

% All different in rows: the 'j' coordinate advances in the column
constraint forall(i,j in v)(
alldifferent([v[i,j] | j in VALUE]));

% All different in columns: the 'i' coordinate advances in the row
constraint forall(i,j in v)(
alldifferent([v[i,j] | i in VALUE]));

% All the groups of cells that add up to 10,
% using either sums (+ sign) or multiplications (* sign)
constraint v[1,1] + v[1,2] + v[1,3] + v[1,4] = 10;
constraint v[1,5] + v[2,5] + v[3,5] = 10;
constraint v[2,1] + v[2,2] + v[3,1] = 10;
constraint v[2,3] * v[2,4] * v[3,4] = 10;
constraint v[3,2] + v[3,3] + v[4,2] = 10;
constraint v[4,1] + v[5,1] + v[5,2] = 10;
constraint v[4,3] + v[5,3] + v[5,4] + v[5,5] = 10;
constraint v[4,4] * v[4,5] = 10;

solve satisfy;

Son: can you help me with this math homework. Is like a sudoku but with other constraints.

Me: sure, let's write this constraint satisfaction problem as a minizinc program ...

Son: cool, but can you teach me to solve it without programming.

Me: what's the point of that.

I am not sure what math skill this is meant to teach other than developing frustration for "math". Are the teachers secretly hoping kids will be learning to formalize CSPs early in life? Because that's what they'll get.

💖 Furra ✨

Behold!! The Croco-Bat (?) 🐊🦇

I finally made my fursona! A mix between 2 characters [A crocodile and a bat] that I used in the past to repesent myself but never felt like those were fursonas of mine at all... until I fuse them ✨

I will continue drawing myself as a human bc I like also how I draw myself in that way, but sometimes I will also draw myself as a furry~ Mostly when I want to interact with my furry OCs (?)

I had so much fun designing her. I even broke some personal rules of design while drawing her and it felt so good~ I hope you guys like it!!!! 💖

#drawing#digital#art

🔄 Magnus 🔄

[12-04-2022 / 13-04-2022]

Another of my old OCs! This is Magnus, he's part of an universe of angels and demons, but he's in the mortal side~

As a fun fact, he have an official ship with Nia, the OC of my friend happyoreof9 @ FurAffinity !

#drawing#digital#art