#loom's code
Explore tagged Tumblr posts
Note
c++ code for basic sliding tile puzzle game that the player must arrange ghe puzzle in a specific order? This is super urgent!!
LORI BABE JUS ASK ME KN DM
provides basic implementation of a sliding tile puzzle game. The puzzle board is a 2d vector and the game logic includes functions for printing the board, checking if the puzzle is solved, shuffling the board, and performing moves. The game loop allows the player to make moves until the puzzle is solved or the player quits the game.
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
using namespace std;
// Define the size of the puzzle
const int PUZZLE_SIZE = 4;
// Define the puzzle board as a 2D vector
typedef vector<vector<int>> PuzzleBoard;
// Function to print the puzzle board
void printBoard(const PuzzleBoard& board) {
for (int i = 0; i < PUZZLE_SIZE; ++i) {
for (int j = 0; j < PUZZLE_SIZE; ++j) {
cout << board[i][j] << "\t";
}
cout << endl;
}
}
// Function to check if the puzzle is solved
bool isPuzzleSolved(const PuzzleBoard& board) {
int num = 1;
for (int i = 0; i < PUZZLE_SIZE; ++i) {
for (int j = 0; j < PUZZLE_SIZE; ++j) {
if (board[i][j] != num && !(i == PUZZLE_SIZE - 1 && j == PUZZLE_SIZE - 1)) {
return false;
}
++num;
}
}
return true;
}
// Function to get the position of the blank tile (0)
pair<int, int> getBlankPosition(const PuzzleBoard& board) {
for (int i = 0; i < PUZZLE_SIZE; ++i) {
for (int j = 0; j < PUZZLE_SIZE; ++j) {
if (board[i][j] == 0) {
return make_pair(i, j);
}
}
}
return make_pair(-1, -1);
}
// Function to check if a move is valid
bool isValidMove(int row, int col) {
return (row >= 0 && row < PUZZLE_SIZE && col >= 0 && col < PUZZLE_SIZE);
}
// Function to shuffle the puzzle board
void shuffleBoard(PuzzleBoard& board) {
random_device rd;
mt19937 rng(rd());
int numShuffles = 100;
while (numShuffles > 0) {
pair<int, int> blankPos = getBlankPosition(board);
vector<pair<int, int>> possibleMoves;
// Check all possible moves
if (isValidMove(blankPos.first - 1, blankPos.second)) {
possibleMoves.push_back(make_pair(blankPos.first - 1, blankPos.second)); // Up
}
if (isValidMove(blankPos.first + 1, blankPos.second)) {
possibleMoves.push_back(make_pair(blankPos.first + 1, blankPos.second)); // Down
}
if (isValidMove(blankPos.first, blankPos.second - 1)) {
possibleMoves.push_back(make_pair(blankPos.first, blankPos.second - 1)); // Left
}
if (isValidMove(blankPos.first, blankPos.second + 1)) {
possibleMoves.push_back(make_pair(blankPos.first, blankPos.second + 1)); // Right
}
// Randomly select a move
uniform_int_distribution<int> dist(0, possibleMoves.size() - 1);
int randomMove = dist(rng);
swap(board[blankPos.first][blankPos.second], board[possibleMoves[randomMove].first][possibleMoves[randomMove].second]);
numShuffles--;
}
}
// Function to perform a move
void performMove(PuzzleBoard& board, int row, int col) {
pair<int, int> blankPos = getBlankPosition(board);
if (!isValidMove(row, col) || !isValidMove(blankPos.first, blankPos.second)) {
cout << "Invalid move!" << endl;
return;
}
// Check if the move is adjacent to the blank tile
if (!((row == blankPos.first && abs(col - blankPos.second) == 1) ||
(col == blankPos.second && abs(row - blankPos.first) == 1))) {
cout << "Invalid move!" << endl;
return;
}
swap(board[row][col], board[blankPos.first][blankPos.second]);
}
int main() {
// Initialize the puzzle board
PuzzleBoard board(PUZZLE_SIZE, vector<int>(PUZZLE_SIZE));
int num = 1;
for (int i = 0; i < PUZZLE_SIZE; ++i) {
for (int j = 0; j < PUZZLE_SIZE; ++j) {
board[i][j] = num;
++num;
}
}
board[PUZZLE_SIZE - 1][PUZZLE_SIZE - 1] = 0; // Blank tile
// Shuffle the puzzle board
shuffleBoard(board);
// Game loop
while (true) {
// Print the puzzle board
printBoard(board);
// Check if the puzzle is solved
if (isPuzzleSolved(board)) {
cout << "Congratulations! You solved the puzzle!" << endl;
break;
}
// Get the player's move
int row, col;
cout << "Enter the row and column of the tile you want to move (0 to quit): ";
cin >> row;
if (row == 0) {
break;
}
cin >> col;
// Perform the move
performMove(board, row, col);
}
return 0;
}
NOTE :
this is a simple example, and you can modify and enhance the code to suit your specific puzzle game requirements.
0 notes
Text
interesting lore moment with the francophone yesterday (as in, it personally gave me brainworms) ft. qétoiles’ horrible, no good, stupid (lack of) self-preservation . subs in English, transcript below the cut
All spoken in French — translated into English subtitles
[Video transcript:
Etoiles: And, actually, I have a theory. Basically what happened is that I’ve just returned from a mission from Cucurucho.
Antoine: And what was the mission?
Etoiles: To do a dungeon, and to recover something from the dungeon.
Antoine: And what was this “something”?
Etoiles: And the “something” was a book that sorta says that I’m a test subject.
Antoine: A test subject?!
Baghera: What’s up with your arm? You’ve got a coded arm.
Etoiles: Uh, it’s from holding the shield, basically.
Baghera: Ahhh
(Pause)
Antoine: Watch out that it doesn’t contaminate you, or else you’ll turn into a code, man.
Etoiles: That’s impossible, man, I can’t be a code.
Antoine: That’s what the old codes said before becoming codes, you know.
Etoiles: No— well, we’ve never spoken.
Baghera: Maybe you shouldn’t be using the shield as much then, no?
Etoiles: Well, as it stands, I’ve been using it for a really long time, and my mind is still healthy, honestly. And the proof is—
Baghera: Well, half of his face took the brunt of it instead.
Etoiles: Yeah, but it’s not all there is, you know.
(Pause)
Baghera: Let me worry, Etoiles, right now.
Etoiles: You’re right. You’re right! But everything’s going well, I’m doing very, very well—
Antoine: It’s true that you look a bit sick.
Etoiles: Uh, yeah, for the past seven years, it’s a chronic illness, it happened—
Antoine: No, but not this one, the other— you seem even sicker, still.
Etoiles: Yeah, okay. Yeah but no, I’m fine. No, no, it’s fine, honestly.
End Video Transcript.]
#qsmp#etoiles#baghera jones#antoine daniel#étoiles#here’s a game see if u can spot the colour coded subtitle i fucked up#sorry if the editing is bad im trying my Best .#jay rambles#jay clips#ccetoiles going ‘hey it could be fun if i played a code’ looms ominously in the background#also shoutout to people who often do translations like these fr fr#this one wasn’t too hard 4 me (fluent in both langs) but it can be difficult to translate#the implicit meanings in certain sayings between languages#i took the liberty of translating the little affirmative ‘quoi’s at the end of sentences#as ‘honestly’s and ‘you know’s since there’s no real equivalent#21/09/2023
728 notes
·
View notes
Text
WOW it's way later than I planned to just be finishing art but here we go! I did manage!
#my characters#honestly still shocked how i made him to be incredibly wifeguy and catguy coded#and only AFTER drawing him with his plus sign pupils realized that his wifes pupils and the cats#basically make a plus sign if you combine them#and thats the coolest two women in his life wow what a winner#also idk how much i rambled in the tags previously about him but like uh he WAS an athlete in competitions#like diving and swimming and such ! but he no longer competes after a head injury#and he just kinda is good most of the time but if he feels stressed he just goes mind blank but foggy#and all that processing power looks like it stops but hes actually overprocessing and zones out trying to sort it all out#and his wife is like My Husband is the sweetest guy i know but he looms over me so I MUST make him wear dark clothing#Its to live out that vampire romance I was into when i was younger C: you know how it is#and all their friends are like no ??? no we really dont know? but ok?#so he wears lots of dark clothing to make her happy but hes just such a bundle of delight to talk to that it doesnt really work#also they are recently married but have been dating and best friends for most of their lives !#and thats about it i think idk ??? i feel like thats a lot of rambling already so good enough im gonna go pass out
29 notes
·
View notes
Text
It is really very concerning that for their date he wore a blue and white hanbok and she wore a pastel pink one.
The last time a couple(that I have been obsessed with for 2yrs now) wore the same colour combination and spend their day happily, things did NOT end well...
#I'm not going to explain any further#you guys know what I'm talking about#this dress code is trauma inducing#it's like something ominous looming above my head#the judge from hell#alchemy of souls
31 notes
·
View notes
Text
Fuzzy shadow creature but I’m feeling a bit out of it recently so my fur is fucking drooping and I look like a pathetic wet beast and my white glowing eyes are like. Sad looking
#looming in the corner of your room but its not ominous in the slightest by simply how fucking pity inducing i look#weeping willow#coded#shadowkin#voidkin#shapeshifterkin#otherkin#alterhuman#Asher’s Ramblings#cryptidkin#creaturekin
9 notes
·
View notes
Text
ZACH TAYLOR x MODERN BASEBALL on JOSH TEMPLETON and ALLISON BANNISTER
[ BROKEN CASH MACHINE | ROCK BOTTOM | THE OLD GOSPEL CHOIR | THE WEEKEND | ALPHA KAPPA FALL OF TROY THE MOVIE PART DEUX (2 DISC DIRECTOR'S CUT) | EVERYDAY | HOURS OUTSIDE IN THE SNOW | NOTES | I THINK YOU WERE IN MY PROFILE PICTURE ONCE | HOME | REVENGE OF THE NAMELESS RANGER | INTERSECTION ]
#super dark times#sdt#zach taylor#josh templeton#allison bannister#sam edits#the number of songs and gifs don't line up bc i used multiple bits of a few of the songs (bcm rock bottom & revenge of the nameless ranger)#anyways was having a 'listen to mobo's dicsography' day + some lines stood out... idk if this is comprehensible to anyone else but oh well#zach is simply sooo mobo coded To Me </3 originally i was gonna do 'zach & josh' and 'zach & allison' as separate sets but i kinda liked#the combo... it's all so twisted up together man!!!! everything happening with josh/the daryl situation being this Thing that blocks#zach from feeling able to pursue her and all (as most clearly laid out during the sex dream where the sword & josh loom over them lol)#oh and if its unclear: pink = zach (bc his cast <3) orange = josh (bc his coat) yellow = allison (bc her sunflower shirt & her daisy shirt)#(even tho those aren't pictured here. those are the costuming things tht stick with me for her)#also sorry this is LONG but i simply have. lots of thoughts. believe it or not this is the pared down version i originally had even MORE
51 notes
·
View notes
Text
...
———
.-.-.- .-.-.- .-.-.- .... . .-.. .-.. --- ..--.. -.-. .- -. ....... .- -. -.-- --- -. . ....... .... . .- .-. ....... -- . ..--.. -.-. .- -. ....... -.-- --- ..- ....... .... . .- .-. ....... -- . ..--.. .-.-.- .-.-.- .-.-.- --. --- --- -.. .-.-.- .- .-.. .-.. ....... .. ... ....... .-- . .-.. .-.. .-.-.- .... .- ...- . ....... -.-- --- ..- ....... . ...- . .-. ....... .-- --- -. -.. . .-. . -.. ....... .-- .... .- - ....... - .... . ....... .--. ..- .-. .--. --- ... . ....... --- ..-. ....... - .... . ....... .-- --- .-. .-.. -.. ....... .. ... ..--.. .-- .... -.-- ....... .-- . ....... .-.. .. ...- . ....... .. -. ....... .. - ..--.. .-- .... -.-- ....... .. - ....... .-- .- ... ....... . ...- . -. ....... -.-. .-. . .- - . -.. ....... - --- ....... -... . --. .. -. ....... .-- .. - .... ..--.. -.. --- ....... -.-- --- ..- ....... -.- -. --- .-- ....... .-- .... -.-- ....... - .... .. -. --. ... ....... .- .-. . ....... -- .- -.. . --..-- ....... .-- .... . -. ....... - .... . -.-- .----. .-.. .-.. ....... . -. -.. ....... ..- .--. ....... --. . - - .. -. --. ....... -.. . ... - .-. --- -.-- . -.. ....... .. -. ....... - .... . ....... . -. -.. ..--.. - .... .. ... ....... .-- --- .-. .-.. -.. .-.-.- .-.-.- .-.-.- .-- .. .-.. .-.. ....... . -. -.. ....... --- -. . ....... -.. .- -.-- .-.-.- .- .-.. .-.. ....... . -..- .. ... - . -. -.-. . .-.-.- .-.-.- .-.-.- .-- .. .-.. .-.. ....... . ...- . -. - ..- .- .-.. .-.. -.-- ....... -.-. . .- ... . ....... - --- ....... . -..- .. ... - .-.-.- - .... .- - ....... .. ... ....... .-- .... -.-- --..-- ....... .-- .. - .... ....... - .... . ....... .-.. .. - - .-.. . ....... - .. -- . ....... .. ....... -- .. --. .... - ....... .... .- ...- . ....... .-.. . ..-. - --..-- ....... .. ....... .-- .. .-.. .-.. ....... - .-. -.-- ....... -- -.-- ....... -... . ... - ....... - --- ....... ..-. --- .-. --. . ....... .- ....... ... - --- .-. -.-- .-.-.- .- ....... ... - --- .-. -.-- ....... - .... .- - ....... .. ... ....... ..- -. ..-. --- .-. --. . - .- -... .-.. . ....... - --- ....... .- .-.. .-.. .-.-.- .-.-.- .-.-.- .-.-.- .. ..-. ....... .-- . ....... . ...- . .-. ....... -.-. .-. --- ... ... ....... .--. .- - .... ... .-.-.- .-.-.- .-.-.- .. ..-. ....... --- ..- .-. ....... .--. .- - .... ... ....... .-- . .-. . ....... - --- ....... -.-. --- -. ...- . .-. --. . .-.-.- .-.-.- .-.-.- .--. .-.. . .- ... . --..-- ....... -.. --- ....... .-. . -- . -- -... . .-. ....... -- . .-.-.- - .... .- - ....... .. ... ....... .- .-.. .-.. .-.-.- ..- -. - .. .-.. ....... .-- . ....... -- . . - ....... ..-. --- .-. ....... .-. . .- .-.. .-.-.-
#(art)hesia#arthesias ocs#rhymix: artwork#rhymix: a looming presence approaches...#not gonna put a character tag here#some parts of this guy's design might give away what song he's based off of actually#if you knew the champion of...oh you know.#also i felt way too lazy to put /'s in between the morse code so have fun i guess#also not gonna put this in like. yk. main tags#gaze into the light (and maybe find your answer there): convergence (oc)
7 notes
·
View notes
Text
dacre dungeon meshi au send tweet
2 notes
·
View notes
Text

The hand cramps are so real. It's actually affecting my ability to keep going 😞
Buuut that's another 2 hours I put into learning a language I'll need to know in less than a month. Once this chapter is done, I'll finally be able to move on to new material!
#my japan trip is looming on the horizon#learning grammar#learning Japanese#studyblr#japanese language#nihongo#langblr#handwritten notes#messy handwriting#messy notes#color coded notes#Japanese grammar
13 notes
·
View notes
Text
Sometimes I think about how badly computers and their associated innovations (read: software) broke people's brains about how technology should work. This is because making software requires, at a first pass, three things: a computer manufacturer to buy a computer from, a programmer, and some way to get the computer (plus maybe a programming book or some internet to the programmer. That's (approximately) it.
This is, to be clear, not normal. Not for things at relatively cutting edge technological activities - if you do benchwork in novel chemistry you will be ordering chemicals and labware and equipment and replacements constantly, if you want to make anything in synthetic biology you will probably need all of those things and then also living things as well that you might have to change for each project you work on - and not for technologies that are pretty normalized. If you work in manufacturing or engineering or heavy industry - or hell, fish processing - the odds are very good that any day your loading dock is not being used is a day that you do not have the critical supplies you need to accomplish your goals. There's just no way around it; even if you might be a manager who doesn't touch the product, your needs and decisions are still driven by the fact that your product is real. The technology and its connection to physical realities are inextricably linked.
And yet software companies are HUGE companies! They drive billions of dollars! It fascinates me to think about how much of the economy is built on the one modern technology that ever so lightly skims against the actual world, the one that's full of real people doing actual things. And even that skim isn't what really matters to these companies! shit's wild
#does this connect in my brain to the fact that most developed nations seem to have forgotten how to actually build stuff?#maybe. I don't know. it feels like it should but also I cannot articulate it.#i also have feelings about how like... computing was invented to do real things#We did not build abacuses and jacquard looms and code breakers for no reason. this disconnect is not inherent to the form
4 notes
·
View notes
Note
Hhhhhngghhhh I feel u about the not wanting to go to work thing I also got someone looking over my shoulder critiquing my shit that they dont even know anything about😭 solidarity✊
😔 right? idk why cant people mind their own damn business i wish we didnt have solidarity tho that sounds rough
Especially l if this area of the company doesnt involve you
And you’re not my boss
But then MY BOSS rolls over to you so its ???? My boss is essentially fueling that their opinion is correct bc of it so its a vicious cycle and we’ve all said hey boss can u tell them to mind their business so we can get on with it but theyre chicken sooooo
Fuck us ig???
#my boss is not a bad person#but they are a very not good boss#like theyre just bad at it. no protection no support nothing they just say yea to anything and then scolds us the moment we have something#to suggest that may make everyones lives easier but no that is not the way#augh. pain#problem is i dont have any other hireable skill other than customer service and i rly want out i hate seeing so many peopleeee#but idk what career direction to take from here without taking a class in like coding or smth#my friend said think of it as picking up a new weapon class which is really inspiring to a weeb like me#but problem is what weapon class lol#like i loom at the job market and whats paying hiring#and theyre all careers im just like ugh about
5 notes
·
View notes
Text
I actually think the idea of Irminsul being an emperors scepter works really well because the scepters function like a system of neurons.
Or maybe I shouldn't say irminsul is an emperors scepter because irminsul and the ley lines are implied to have always been there. Rather, the modifications made to irminsul and the ley lines by the heavenly principles are the result of integrating a scepter into the equation. The modifications that stumped Kukulkan because he can't figure out how PO did it.
But like, anyway, consider neurons - if you incorporate the likely possibility that dendro was not only called dendro because trees form dendritic patterns, but because of the dendrites that are a part of the neuron structure -
Uh yeah.
Maybe there's more than one of them, maybe the moons were scepters, too, and the "lunar reconstruction" referred to in Chronicles of the Crumbling City is referring to Nibelung finding a bunch of scepters and restoring them to operational function and he used them to make the world, like shown in the Ochkanatlan mural.
#the ochkanatlan mural with Nibelung kind of reminds me of the Tayzzyronth ones in the eye of twilight#the way theyve got this impossibility large entity looming over a world#which prompted me to blurt out to my partner 'what if Nibelung is a BUG!#bug#thats probably just crack#dragons are more dusk leviathan codes than swarm disaster lol#hsr#hsr lore#genshin impact lore#hoyoverse
0 notes
Text
all the other social media apps make me want to buy useless shit but tumblr will have me wondering if I should get a loom
#does anybody have a loom discount code#it’s crazy how popular looms are on here#just fiber crafts in general#like should I try getting into those weaving card things#loom pilled#loom
0 notes
Text
Asking other devs on the team for a code review is so embarrassing... i myself dont even want to look at my code but i have to ask someone else to look over it and criticize it
And then they look at it and find all these dumb things i wrote and mistakes i made and its like yup. Im a dumbass. Thanks. Gonna fix them now.
#cael posting#struck up sort of a friendship with a guy on the team who is mostly kind but detailed and gives me actual suggestions#appreciate him especially since im new to the technology that is used in this project and the deadlines are looming so i have to rush#and cant spend long staring at code wondering if im doing things in the most correct way#im such a dumbass. making the dumbest mistakes constantly. i do learn things though.#problem is my mistakes become more and more complex lmao
1 note
·
View note
Text
when i was a kid i made up a society where they tracked birth sex for reproductive reasons but it didn't particularly determine adult gender, because that was tied to your job--like at some point they got so attached to gender roles that they decided the performance of a role determined the gender. (which historically has been the case quite often, just not to this extent lol.)
it was in the context of a badly written short story where an anthropologist had just straight up failed to grasp that this was how it worked for a humorously long time.
If somebody pitched me traditional gender roles for the first time they would have me in the first half not going to lie.
Oh, in a complex society with a massive amount of required knowledge and responsibilities, two people traditionally partner together so that the knowledge and responsibilities can be divided between them? Awesome!
Wait what do you mean the responsibilities are assigned at birth.
WHAT DO YOU MEAN ONE HALF HAS FEWER CIVIL RIGHTS.
#i don't think i really knew trans people were a thing at the time#or had even heard of like gay marriage#this was just me processing gender as social construct in like the sixth grade#i put another layer on it where your work focus determined your gender#but whether you were able/willing to do it from the home determined your role in your marriage as husband or wife#and these did not always match the gender because the rules had been codified when their economy#was much less complex#so like weaving was women's work but if you did it in a commercial workshop and were married that made you a/the husband#and if you got a home loom after the kids came along wife now#one issue was if you became disabled or had another life change and had to switch vocations to something with the other gender coding#you had to swap your gender presentation also or people would get weird about it and among other things undervalue your work#because you were Doing It Wrong if you had the wrong literal hat on#also obviously the amount of pressure your parents put on you to select the career and gender they thought best#underwent multiplicative growth probably lmao#the fact that the whole family were basically fulltime farmers in the majority of families throughout history#was not relevant to my worldbuilding at age eleven
17K notes
·
View notes
Text
hmm what new thing am i going to learn this year just realized i havent thought abt it.
#i mean i know the basics tho i havent really actually done it b4 so myb loom weaving?#or myb i will spend the time tyring to improve in the things i just have bare knowledge in#like coding#hmmmm#cloud nonsense
1 note
·
View note