Activity

Simha Saraswati

YES! Got rid of the Re reading logic. Also, side note, the thing was NOT working in the previous dev log. I wasn’t actually using the padding bits for the error correction. So first i fixed that. Then i basically got rid of it cause i finally understood i could easily reconstruct the bitstream. So did that and ik its really janky, but its fine. Also added a debug button so you can quickly switch modes without changing source code cause it was getting annoying. Lastly, i am a bit concerned now that i made eventlisteners on input rather than onchange about hte scope of variables. If it changes mid function that could be bad. NEXT STEPS: let keyword for all non-global vars, 2 bytes for message length in some versions, error correction in blocks, logo in code, info page

0
Simha Saraswati

The demo doesn’t really show much, but i basically just converted everything(EXCEPT that one thing for messageCoefficients). It was really hard because if i made one mistake or lost my train of thought it is really hard to get back into it. I really want to get rid of message coefficients. Or at least it shouldn’t reread the message. Instead, i will probably have message coefficients break it up into sections for error correction to handle or smth. TBH i just don’t like it. NEXT STEPS: stop rereading message, 2 byte length in some versions, error correction in blocks, logo in code, info page

0
Simha Saraswati

Lwk don’t know how this took same amount of time as teh alignment patterns. Oh, actually those weren’t all coding, so makes sense. But basically i just replaced wherever i was setting into codegrid directly with an offset and in drawgrid i used the array. It’s working now, but one small thing i want to change is that I don’t like how it’s in a random order. I did kinda do whatever i wanted when making it originally, but now i want order in array to be order it is created: base, data, dataRead, padding, error, format, version. Also lwk i don’t like dataRead, might just not have that in the future. IMPORTANT: just found out htat in some versions, url lenght byte is not 8 bits, it’s 16 bits(2 bytes), so gotta account for that. NEXT STEPS: Finish up array debug, get rid of messageCoefficients function, 2 byte length in some versions, error correction in blocks, logo in code, info page

0
Simha Saraswati

GOT DYNAMIC ALIGNMENT PATTERNS. Yo ts was actually hard because docs(ones i could find, not official one) said just use a lookup table. So i had to actually look at the qr codes of all types and get my own algorithm. Idk if this is official algorithm, but it works for all qr codes 1-40. A lot of the time is not recorded cause it was on paper, not computer. I’m gonna do the debug thing first cause i know once i get error correction workign i’m not bouta come back and fix the horendous debug code. Also i realised i can put logo in a qr code. NEXT STEPS: better debug, error correction in blocks, logo in code, info page.

0
Simha Saraswati

I learned the remainder bits aren’t always 7, they are different based on version. I tried hella to make it dynamic calculation like for padding, but finally gave up and just used a lookup table. Might try going back to dynamic later. Next steps: Alignment patterns, BETTER DEBUG MODE(array for color to num), info page, error code blocks

0
Simha Saraswati

Finished version info. Couple issues i ran into was paramaterization and version not being an int(it gets treated as one when u do arithmetic with it but not otherwise). I also implemented the same logic to extend the version as i used for format strips. Then write them in the appropriate areas. I got really confused that it wasn’t scanning, but the problem was that i didn’t do the aliignment patterns based on the version, and also i had completely forgot about this, but in bigger qr codes the error correction is calculated in blocks. NEXT STEPS: alignment patterns, Error code by BLOCKS not as whole, info page

0
Simha Saraswati

Did size parameterization for all nextPos and writeBytes and didn’t want to acces global so did it kinda roundabout way where some functions atke in size just to pass it on. Also fixed display and alert. Right now, the only VALID qr code is v2. Howver, all versions display something. To make it actually valid, i need to make alignment patterns dynamic and add version info. I think that’s it, maybe timing patterns go away. Theoretically, error correction is alr working. As u see it has the correct num bits. Small problem i ran into was the max size for the canvas, but that was fisxed by just making cell_size smaller(I’m so smart for including that in the first place) NEXT STEPS: alignment patterns based on version, version info(timing patterns might disapear), Info page.

0
Simha Saraswati

So i first wasted a bunch of time trying to edit csv file to also have size which doesn’t work cause the map is based on level not version. Then i just made a slider and integrated it anywhere that was counting from teh end of the grid. JUST REALISING I DIDN’T DO IT FOR NEXT POS. Also sitll need to actually do alignment patterns, cause i just basically did find replace ,no logic

0
Simha Saraswati

Make the logic for detecting if a url is too long. My previous logic was dumb. I was checking if the length was less than 255. I got that number from 255 being teh largest 8 bit binary number. So 255 is maximum ascii value, not length. To fix, i already had the available_bits, so i just made an error_bits, so available_bits-error_bits = available_data_bits. required data bits = 8*length+8+4. each char is 8 bits, plus 8 bit length identifier, plus r bit terminator(Just realised while writting this that technically this shouldn’t be included since terminator is supposed to be 4 or less). Made function for this and also made selection for level better. Moved some stuff around as well. I had really hard tiem with this project, so i also want to make the info page have everything you would need to make your own qr code generator(explain steps in detail, but don’t do pseudo code. Ex. “div message polynomial by generator polynomial in gf(256)” instead of “Exact steps to do poly division as well as galois math.”) Basically the documentation but in a more readable format. Cause the documentation theoretically exists but i couldn’t find the og source anywhere. NEXT STEPS: Version QR codes, info page and css.

0
Simha Saraswati

Create the map so and paramaterize the error correction level. Ik the UI is kinda ass, but it works. HOWEVER, big issue is that right now the BLOCK thing doesn’t work. Since i’m only using v2 right now, it is fine because all levels in v2 are 1 block, but yeah. Also keep in mind that since this is a v2 qr code, your text cannot be very long at the high error correction level because error correction takes up stpace. NEXT STEPS: need to fix the max url size error, and then need to make it for higher level qr codes. I also wanna fix the css cause right now it’s kinda ass

1

Comments

Simha Saraswati

YO I SHOULD MAKE A DOWNLOAD BUTTON

Simha Saraswati

Made multiple mask methods. Originally made a better version for mask 0 because its really simple but later ones can’t be simplified so it was better to just leave them all as math formulas to be consistent. All formulas are from thonky’s website. Also, another problem was mask_input.value is a string sothat .toString(2) doenst binary it. instead cahnge to num before passing as param

0
Simha Saraswati

YESSSSS LESS GO. IT WORKS. this is literally so fun. Ok, so there werent’ that many problems. I asked it to do all the BASIC galois math(+-*/^ and log) BUT NOT the polynomial stuff. I also had it check everything. It found that in the format strip, you don’t want 10 for medium, you want 00. IT WORKS NOW, LESSGO. Next steps gonna be scaling up to v40 qr code, and making more mask versions and more error correction levels. THIS SHOUDL GO TO YOUTUBE.COM

Attachment
0
Simha Saraswati

IT DOESN’T WORK. Uk what’s even more annoying? The problem is in the math, the hardest part of it. Basically, i was debugging it with ai and then it led me to this website which basically does what i want to do so i put “www.youtube.com” in both and started looking at differences. No diff till the error correction part. Also format strips are cooked. I was looking on thonky’s guide and honestly it kinda sucks cause it told me to do most of theformat strips and they ended up wrong. Ig i have to fix it somehow now. HOWEVER, i think i’m getting message and generator polynomial cause even though gemini is retarded and argued with me for 1 hr that my message polynomial was wrong before finally accepting it was right(i didn’t bully it, just asked to explain why it was worng), it did say that generator was right from the start. So uh, gonna jump off a bridge now(this is a joke).

Attachment
0
Simha Saraswati

Once i got galois math down, i just started writing bits. However, i ran into some probs with the nextpos. The vertical format strip screwed it up. I spent some timetrying to fix it blindly without understanding the proble. That’s literally all i did. Also, i made error correction green so u can tell where it starts. Also, last 7 bits are just empty, cause they useless. Why do i sound like i’m writting an essay for english class

0
Simha Saraswati

BRO THIS IS AMAZING. I had to implement this annoying thing called Galois fields cause for some reason you can’t use normal math in qr codes(the reason is that you want it to always be writable in a byte, so 256 is the max num u can have). IT’s annoying cause you have to 1.) look through the web to get all the galois math and not from a qr code website tutorial and not from ai cause ur better than that, 2.) understand how and why it works, 3.) Remember what parts of the math need to be done with galois math and which are normal math(like do you want to add or XOR(galois add)), 4.) get the exponent and log lists(got from thonky cause i couldn’t find anywehre else and i’m not bouta generate that, too much work), implement a logic to store polynomials as arrays with the first idx being greatest degree(this is stupid, should have done idx = dgreee), then work around that cause u an idiot, and then get into problems cause you said 1-alphai which puts it outside galois field so you should just say 1+alphai, then maek a generator function, then use gemini to check ur answer, have gemini complain at u cause u accidentally copied the indices of the coefficients as well, BUT FINALLY IT WORKS AND NOW I’M IN THE HOME STRETCH. Just need to write these bits, do masking(i’ll probably just do one pattern to start with), write format strips. Then i’ll probably make it hella customizable like colors, version num, error correction level, masking method

2

Comments

Noten
Noten 28 days ago

didnt know there was so much math involved

Simha Saraswati
Simha Saraswati 28 days ago

😭Yeah, math is mostly for error correction tho, for most of it its’ just converting to binary

Simha Saraswati

Fixed the padding 236 and 17 thing. Basically i keep track of how many writable bits are left. To do this, first take the whole grid(25^2), then subtract each base pattern as you set it. Total 270 base bits as u see me highlight.(mode:4, alignment pattern: 25, corners:3*(64)=192, format strips: 33, timing strips:16) Left over is 355. Then write data bytes, each should take away exactly 8 bits from the available bits. After writing data bytes, you add another 4 terminator bits, so those get removed. Then you want to keep going as long as you have MORE than enough to write the error correction and version info bits. Remember, if you can write another byte, then 8 bits are left, this means i didn’t really think about if it’s > or >=. Then to get # of bits requred for error and version info, you do n_per_blocknum_blocks8+7. n_per_block is just total_n/num_blocks, so n_per_blocknum_blocks = total_n/num_blocksnum_blocks = total_n. total_n is # of ERROR CORRECTION(not including version info) BYTES, so to convert to # of bits, multiply by 8. Lastly, +7 because there are 7 version# bits according to this image i found online. Rn i have no clue what level of error correction i’m using, but i had gemini generate a whole csv file full of the things, which can’t attach here. IT basically tells teh n_per_block and num_blocks for each level of error correction for each version qr code. next need to actually put info in format strips, masking, and create generator polynomial. I foudn formula for generator polynoomial online(not gmeini), but it’s complicated so will need to make a funciton for it.

Attachment
0
Simha Saraswati

Started with error correction. Found this really useful picture that shows what is where. So 7 bits tell version info, and the rest is straight forward. IT DOES NOT SHOW CHARACTER BYTES FOR DATA. It shows codewords, so this is shifted by 4 bits because of the mode in the bottom left. The error bytes is what i’m interested in right now. So i did what i thought is right which is force go backward from end, and try to hug the left(opposite of when going forward) but as u can see this screws up e11. Also i commented out the code for this part but your supposed to alternate 236 and 17 to fill up any empty data codewords. Error thing should be easy once i have the start of e1. I need to really think about how to reverse engeneer nextpos, to get prev pos. I think i still need to hug right, but go up when i’m in the right instead of when in the left

Attachment
0
Simha Saraswati

It’s hella annoying cause ican’t log research hours otherwise i would have like 20 hr by now. Ok, basically i just wanted to devlog an idea i had. If instead of recursive, i implement nextpos iteratively, then i don’t have to do the whole “Set to 4 and 5” thing, i can just force one move, and then keep same logic for rest of moves in a while loop. Now reason i need this is for error correction, first i need to go back by # of errof correction bits(n per block*# of blocks*8) and then store that position, then start up again from wehre i left off after the terminator padding of the main data, then padd the required 63 17 alternating, up till the start of error correction. btw if u were wondering, i would really recomend whenever doing smth like this, put the grid on top cause it’s very helpful for debugging

Attachment
0
Simha Saraswati

Fixed WriteBytes skipping thing, i realised you always want the right one if possible so no need to save col offset when skipping the base parts. Now i also started error correction. For error correction, you need to convert all the data (including binary mode) into codewords. Codewords are bytes of data. Because bin mode is 4 bits, you pad the 4 end bits. Then you can convert codewords to decimal to get coefficients of a polynomial. Now if you divide this polynomial by a generator polynomial(that i need to figure out how to get) Then you get a remainder, that remainder is the error correction bits. The phone uses reed solomon to get it back from that polynomial(it’s hella interesting, you might wanna look into it). But basically, i did polynomial division with quotient and remainder(even though i don’t need quotient) and also got coefficients from codewords. I set bits to 4 and 5 after reading them the second time. This way i can still use nextpos. Now just need the generator polynomial and then the masking. I also need format strips and i want it to be completely customizable(all versions of qr codes, all possible modes(bin alphanumeric numeric, not kanji), and all possible masks)

0
Simha Saraswati

WRITEBYTES IS WORKING! well kinda. So teh logic is sound, and its working great, but one extra row next to the alignment pattern is skipeed, BUT it’s still empty(because it shows red). While typing this i just realised that it’s probably because i only check the right cell, so i should check right and left cell each time row increments. So far it’s looking just like veritasium iks doing so far. Another small problem was there were no formating strips. Ur not gonna believe how simple the main writebytes problem was. I just was forgetting to subtract column offset DURING my calculations, not while setting the bit.

0
Simha Saraswati

So small thing needed for base. I realised now i could have just filled the thing with -1 instead of 0 which i will have to do anyway, but basically i made all the areas that are white but in the base 2 and all the black in base 3. Then i also made an outline function that makes squares given start and size. Thsi made it easier to do all the outlines. Ig the whole 32 thing was bs cause i’m gonna have to use -1 anyway, but now what i’m going to do next is working on the writebyte logic. Rn it just goes int the correctpatter but it needs to be able to handle already filled stuff and also changing direction(when you reach teh edge of the qr code)

0
Simha Saraswati

Finish the base of the qr code, meaning everything that will stay same(for now) independent of the input url. I also realised that i cant just have 1 and 0 because later on the zig zag pattern needs to skip the base parts, so i made the base 2, black(data) 1, and white(data) 0. This will be useful for debugging too. Also in console it give sthe ascii code of each char and the bin representation of length of the thing. Need to pad 0 on it now

0
Simha Saraswati

I made all the required files, and started with actual logic. I have now the grid, and i’m starting the boxes(the 3 in the top left, top right and bottom left corners) those are always same. It’s working butit’s hard to see so i’m gonan do display next. Im debating between having a canvas and if there’s a way to have just 25 elements next. to each other who’s background color i can change

0
Simha Saraswati

Add instructions to instructions page🤦. Hopefully don’t get rejected again! tho lwk rejection an old friend(that was tuff and you can’t convince me otherwise)

0
Simha Saraswati

Shipped this project!

Hours: 23.63
Cookies: 🍪 625
Multiplier: 26.44 cookies/hr

I built a maze generator and simulator! It was really hard to figure out DFS generation and Simulator, but i did it by using global flages. I’m Most proud of the simulator and the multiple canvas logic.

Simha Saraswati

Fixed colors, and made it realy obvious that there is a simulaition. Last devlog, see u in the next project :)

0
Simha Saraswati

Added simulation page. Support for origin shift, dfs, and hunt kill. I’m gonna abandon dsu. Gonna ship soon, need to clean up code and maybe css. Also I’m really proud of this part, i added a global. flag to make sure only one simulation can run at a time, and it waits for others to abort before starting current.

0
Simha Saraswati

I made better colors for the maze so it actually kinda looks lit up now. I also just made the base of the info page but haven’t made sims yet.

0
Simha Saraswati

Bro Ts is so annyoing. I tried DSU, but then i realised i have to somehow generate randomly between 2 nodes, and i have to choose both in a connected region and it’s gonna be hella hard so just abbandoning it for now. Gonna work on the sims first. Vid is kinda ass ik

0
Simha Saraswati

I ADDED A TIMER! The math is hella chopped but it shows seconds(up to hundereths place) then minutes, then hours. If more than 24 hours, cry about it. I’m not bouta do extra stuff to make it say days cause u had a skill issue(though lwk full sized dfs map could take that long). I also added the blind mode resetting correctly, ti reveals the maze after it is solved, then again blinds after generatikng new. I don’t think yall understand how dumb i am. I kept making changes and was like “why can’t i see the changes”. I WAS LOOKING AT THE GITHUB PAGE, NOT TEH FILE. Next might add the dsu method But definitely the info pages, maybe with a simulation for each type. Ig i would just have to draw maze after each step. It might work for small size. Also dfs is gonna be annoying cause i gota show the solution path then the generation.

0
Simha Saraswati

I added a timer, it’s not working right now completely though. The problem is after full minute, the resetting thing is wierd. I don’t really get it. I also fixed blind mode first load, problem was edge length and offset are null first time, and lastly, I fixed user pos. Before, since i was clearing the circle BEFORE setting new pos, it didn’t look centered. OHH and also i made ti scale, so now u see abt 3 intersections at all times, no matter size of maze. Diabolical for full sized dfs maze. Also gonna now add the last things which is Simulations, prob no 4th maze gen method

0
Simha Saraswati

Added downloading and blind mode. Problem with blind mode rn is that on the first one, it goes copmletely blind, like you can’t even see the circle around the player.

1

Comments

developergirishgiri
developergirishgiri about 2 months ago

nice plz give me vote also and follow me

Simha Saraswati

I Implemented the multiple layers! The order i figured out should be maze, user, blind, solution. Reason is maze is base, maze and user need to be hidden by blind, and solution should always be seen. In reality, maze and user order are interchangable. Right now, the bottom collor of layers degrades top color. I had to use really bright green for it to seem even this green.

0
Simha Saraswati

I made multiple canvases that overlap. That way I can have the solution, user, and base maze on 3 different canvases. This will allow me to easily hide them without having to redraw anything. Also, I came up with this hella cool idea during math class cause i was bored. Basically, u konw thos retro games that have the guy going through tunenls and he can only see some of his surroundings cause rest is to dark? Basically same idea in here, i’m gonna overlay another canvas which blacks out everything except a circle around user. I don’t have to redraw whole hting each time, just draw rect over the curr circle, then clear circle next to it. Other ideas i had was to add a save mode(like to pdf so people can print easily), a stop watch, an info page explaining how each gen method works, animations of the maze generation on that info page(not 1 time recorded stuff, like dynamically generate simulation), and one more method, which connects nodes randomly and then uses an algorithm kinda like DSU to join the maze. I don’t know how much of these i will get to, but will definitely do the overlay canvases

0
Simha Saraswati

Fixing the whole logic. Now what we do is dfs the solution path, then STORE the solution path, reset everything NOT on the solution path. After that, you go to each node(in a random order) and check if it has any unvisited neighbors. Unvisited neighbors means parts of the maze that the user cannot currently visit. To fix this, start dfs FROM THIS NODE, to it’s visitable neighbor. This opens up the section. In the video, I’m pointing out where a section got opened up

0
Simha Saraswati

Ok, I REALLY like this method of dfs, It is fun to play because there are many ways u can go. The method is to dfs generate the solution path and then go back to all the unvisited parts and open those up using dfs. However, for some reason right now there are parts that GET EXPLORED but not connected to main path. This is because of ghost paths. Basically, when i dfs, somehow i leave traces that i visited a node even though i’m not using it. I tried to fix it but debugging is hell

1

Comments

Simha Saraswati
Simha Saraswati 2 months ago

I’m pointing out one such closed off section

Simha Saraswati

I tried fixing dfs a couple of ways. I tried multi headed bfs and dfs combo(like bfs through seeds but then dfs a tree of len 15 or less from seeds). However, that doesn’t have the cool patterns from dfs(the really long paths). The thing i’m gonna try now is having it generate a dfs path, so it will be really long, then from a random point or smth on either side of the solution path, run dfs and then connect the 3 parts. Right now there’s an infinite loop so the vid isn’t really intersting

0
Simha Saraswati

SOLVER WORKING! So basically, i release bfs from BOTH the start and the end of the maze. Once they meet, i stop. When showing the solution, I go from the meet point to the start, then from the meet point to the end. This path is stored. DFS was tweaking cause it had an opening at the start before solving. DFS is slowest, but it’s paths are the coolest. I’ma try to optimize it. First using a stack and then storing the open nodes or smth

1

Comments

alarixfr
alarixfr 2 months ago

amazing

Simha Saraswati

Can actually find the solution now! Do this by using bfs while going down. If the parent of a child node HASN’T been set, then set it to the current node. Have to check because bidirectional. So if u go from a to b, b detects a as a child. Then when displaying hte solution, just look at parents from the bottom right until you reach 0, 0. Now need to actually draw path on. the canvas.

0
Simha Saraswati

Converted Path_maze to use booleans because before it was double counting directions. For example a cell might have stored up, left, up and store up twice. This would have made bfs solve slower(i’ma implement that next). Now get_direction_chioces gives list of indices. 0 is left, 1 is up, 2 is right, 3 is down, and 4 is endpoint(previously ‘O’). Then instead of adding direction to end of a string, you set it’s value to true inside the array.

1

Comments

Simha Saraswati
Simha Saraswati 3 months ago

BTW, bfs is just djikstra but better because all edge weights are same. I did make a pq and crash out about it(check git commits)

Simha Saraswati

First devlog of the new year!🥳. Hope this one is as good as the last. Ok, now the actual material i did is that i fixed dfs logic(make it use the double arrow format which enables 0,0 detection instead of visited counting) Also lay down basics for the Solver. Use the multiple arrow format to add a start and end to the maze(ran into brief problem with endpoints there). NEXT STEPS. JS doesn’t have priority queues which are needed for djikstra. Ik u can do it using arrays but then time complexity is V^2 and at that point use bellman ford. Also, it’s too slow for us. So gotta implement PQ. 😁(that’s smile is sarcastic btw)

0
Simha Saraswati

Made the Display able to give bigger mazes. DFS is the slowest because it has to back track every time it gets stuck. Origin Shift is better, but you need to shift a lot to make sure entire maze is properly scrambled. Gen 3 is the best because when it gets stuck it just teleports to a different point. It has to sacrifice memory to do this, but 450^2 isn’t that much memory. If you had enough time, DFS can generate 450 mazes.

0
Simha Saraswati

Gen 3 working. The problem was that if more than 1 node gets stuck (it has no visitable neighbor) and all other nodes are visited, that means the code will keep looking at the backups, all of which are stuck, making it an infinite loop. Easy fix is to set them to ‘O’ so that it doesn’t consider it a backup anymore and the draw function already handles those. now ‘O’ just means an ‘endpoint’ node. In origin shift, thats the origin, in dfs, thats the leftover node at the end, in gen 3, it’s any stuck node. Next, i want to remove the use of visited variable in dfs. I think you should be able to stop if you go back 0, 0, because if all it’s children are blocked, then it too is blocked. And no, it can’t be that you only explored 1 branch unless that 1 branch ends at 0, 1 or 1, 0 in which case you can just make 0, 0 an endpoint. I’m not sure that will work though

1

Comments

qwik
qwik 3 months ago

i’re a yapper cool project either way :pf:

Simha Saraswati

I realized that bfs can’t work because you would have to go through each node in a level before continuing, resulting in a rougly same maze every time. Even if you randomize the order that you go through a level, it still says the same. I am thinking of storing all nodes that can be visited and then randomizing from that, kinda like djikstra, but it wont be called bfs, for now i’m just leaving the name as gen_method_3 and will figure out later. The reason you see bfs doesn’t work is in the diagram, no matter how much you randomize the order of the nodes, they still go in the color coded order, green to red.

Attachment
1

Comments

Simha Saraswati
Simha Saraswati 3 months ago

actually after the 4th diagonal you would only have one arrow per node

Simha Saraswati

Finished DFS. The problem was that It got confused when all neighbors were visited. Also i said != when i ment to say ==. Basically, now it stores which way it came from and if there are no neighbors, go the the parent. Then if that parent had any leftover childs, use those, otherwise go to the grandparent, so on. only don’t consider it as stuck if visited == total number of nodes.

0
Simha Saraswati

Tried to implement DFS generation but theres an error in the logic so it blocks off and there is no path through the maze. Also i spent a lot of time debugging that i didn’t change the value of the selector to dfs, only the innerHTML.

0
Simha Saraswati

Origin shift is working! Next im gonna add dfs and bfs generation before djikstra solve and maybe more solve and gen methods

0
Simha Saraswati

Started with actual origin shift! Made it generate the base maze, which would look like the other file i uploaded(edited in preview, that was painful) shows how the mazes work. The green is what is stored in the code and the blue is the corresponding maze

Attachment
Attachment
0
Simha Saraswati

Basically starter code, creating the base. I made 3 files for the website(html, css, js) and added elements to the html that i knew i wanted. I need a canvas to show the maze, a selector for which method to generate the maze by(I plan to have at least 3 but i’m gona start with origin shift), a range for how big to make the maze and the solve button. In js, i added the listeners so the label for the size changes as you move the slider and it makes the maze as soon as you let go(right now empty matrix). I also made the css dark mode everything

0
Simha Saraswati

Shipped this project!

Hours: 12.21
Cookies: 🍪 252
Multiplier: 20.68 cookies/hr

Made the Enigma machine, based on the enigma m3 from WW2! You can use it to send messages to your buddies, and just like the real machine, if somebody uses your same rotors and plugboard pairs, unless they sent the same number of messages of the same length(gets the rotor to right position). Overall, I think it was really cool. Before this I did mainly back-end, so doing front-end was challenging for me. Overall, i really like the layout!

Simha Saraswati

COMPLETELY FINISHED. A big bug that i hadn’t noticed before (because i didn’t type huge messages) is that the rotate rotor logic was wrong. Last rotors wouldn’t seemed like they would never move. What was happening was they were moving every time before. Idrk how to explain it, but the fix was that you only check rotor at position i if rotor at position i-1 moved. then i added the whole cookie logic so you can actually keep the rotor positions without leaving the tab open. And because i added cookies, i also had to add a reset rotor button. Also i added the instructions page. Done now!

0
Simha Saraswati

FINISHED (most of) THE PROJECT!! Now you can acutally see the plugboard pairs, u can reroute them if you make a mistake. Only thing i need to do now is make an explanation page that says how to use the tool cause honestly if u don’t know how the enigma machine works u probably wouldn’t know what the hell is going on.

0
Simha Saraswati

Made the Rotors better. Now you can choose how many rotors you want using the slider and choose the rotor by filling in the box!

0
Simha Saraswati

If you want to send multiple messages without resetting rotor position, you can do that now! you can delete the plaintext and start typing a new message and the ciphertext will reflect that! I spent some time on trying to make typos work(you typed wrong letter so you delete it and replace) but this doesn’t work because then the program uses wrong rotor positions (and this is historical, no way to fix it). Theoretically you could turn the rotor BACK by how much they delete but that’s just not worth it. If you can’t type that’s a u problem. Also, instead of using the plaintext itself as a queue and removing from it, i am using a position variable that indicates up till where you have calculated the ciphertext till. This way you can still see the plaintext when you copy the ciphertext.

0
Simha Saraswati

I made the input method better. Basically, now it will calculate the encrypted method every key press, but then we can’t necessarily keep up, lets say user copy pasted a message or maybe is just typing fast(bc we use animation) we won’t encrypt everything. So my first idea was to encrypt everything in the input box every time we press new key, but that doesn’t work becaus then it say the user puts in the alphabet, we will consider the message aababcabcd which is wrong. So then i thot, lets keep a track of what is the longest message that we know they have entered and only calculating the new part. Once enter is pressed, clear out plaintext. However, that doesn’t work because there are conflicting accounts of “latest calculated string” so it fails on fast type. I think the problem there was something to do with requests being handled on sepereate threads. What i finally did, is for once in my life found a practical implementation of datastructures. I implemented a queue directly into the plaintext and a flag to see is stuff being handled rn. If yes, you don’t do anything because your character wiill eventually get processed as part of the queue. If no, then start the queue, and if new characters are typed they will be added too.

2

Comments

Simha Saraswati
Simha Saraswati 3 months ago

Btw, after typing the message i reloded and then pasted the encrypted message

Simha Saraswati
Simha Saraswati 3 months ago

Just realised the audio, i was listening to music so i didn’t realise and my fam was watching a movie in the background

Simha Saraswati

Made lampboard! it looks kinda bad rn but i am hopping to ad an animation and maybe make the padding round somehow. However, i need to first focus on plugboard, keyboard, maybe rotors animation.

2

Comments

Simha Saraswati
Simha Saraswati 3 months ago

BTW, there is no animation for non letter characters, but they show up in final ciphertext

Simha Saraswati
Simha Saraswati 3 months ago

Just realised the audio, i was listening to music so i didn’t realise and my fam was watching a movie in the background

Simha Saraswati

Removed the reversed alphabet. Honestly, idrk what else i was tryna do but i did a bunch of cleanup and then it didn’t work or smth

Attachment
0
Simha Saraswati

It’s working “Yay!” basically the problem was that i wasn’t shifting back when exiting a rotor. lets say user typed ‘A’. When you enter rotor 1, you don’t enter wire ‘A’, you enter wire ‘A’+position. Lets say the output of wire ‘A’+position is ‘B’. You can’t input ‘B’ into rotor 2, you have to input ‘B’-position because you need to shift back so that you can factor in the position of rotor 2. That was hella confusing but idrk how to explain it that well

Attachment
Attachment
0
Simha Saraswati

Dealing with scope errors right now and it’s hella annoying cause according to w3schools, if i declare it as var, it will automatically be accessible inside the function which doesn’t seem to be teh case. Btw, i used small python script to generate a reveresd alphabet for each rotor, that denotes the path when going back through the rotor. I will probably still need to debug the logic for doing this backward alphabet, but the changes will be in python file now. This way the js file stays clean

Attachment
0
Simha Saraswati

I tried to implement the whole thing, but right now, even though it’s scrambling into a letter, the decryption is not working. Enigma machine is supposed to be, lets say you used rotors 1 0 and 4, with no leads, then typed “HELLO WORLD” and got “XERCL DSOPL” then somebody else should be able to use rotors 1 0 4 and type “XERCL DSOPL” to get “HELLO WORLD” but right now it’s not working

Attachment
0
Simha Saraswati

Finish the setup, now i am moving on to the actual encryption. AKA, the plugboard, rotors, reflector, rotors, plugboard sequence. Also, i finished the plugboard logic.

Attachment
0