Activity

Simha Saraswati

Pages actually do look the same, i wasn’t considering format strips. I finished up the design of the main page, with teh coloring and stuff, i had to make 2 diff versions for webkit vs mozilla. I started on the info page, here is a proof of concept of how i want layout. I’m gonna make a selector to change which paragraph is shown. IDK why the paragraph is extending past the web view. I’ll have to fix that, ifinish the selector AND MAKE THE AUTO SELECt MASK. Add logo input label. Also, i want to make it so when u go to info page from the main page or vice versa, it transfers settings so u don’t have to re type them.

Attachment
0
Simha Saraswati

Made info page html work with script.js instead of it’s own thing. Had to make debug a global var and change depending on the try catch blocks. Looking rn and seeing that the info and main page don’t really look same qr code with same params. Will check that later. Main work will now be on info page and little main ui

1

Comments

Simha Saraswati

NEXT STEPS: Fixed ui on info page, little modifications to ui(fit theme with buttons), and auto choose best mask method.

Simha Saraswati

I tried just making the thing faster wihtout canvas, but that honestly didn’t look great. So now i finished landing page, i made color changing, i made text changing, also color high contrast, and static sized title holder so buttons don’t move. I loved making this page, but its time to finish the mainpage ui and then implement it onto info page. Idk if i’ll do auto mask anymore

0
Simha Saraswati

Turned text file to usable js file, made drawCode work with it, and also made it so no codes don’t appear twice consecutively. Main thingi want to do now is make it WAY faster, but then it lags, so my Epic/Stupid idea is to have 20 canvases overlapping with the qr cocdes written on each, and tehn change which is visible for fast changing. Next will just do changing font as well, and color, then done with landing page

0
Simha Saraswati

A LOT of work was backend. Pls understand. I didn’t want to copy paste the whole file for backend, so instead i parameterized EVERYTHING so it would workif i gave it custom values or if it had to get from html elements. I will be able to use this for info page as well. Next i actually started on the landing page qr code switchy thing. I started with setInterval, but that was too laggy for big qr code versions, it wasn’t consistent timing. Now in python i could do with while true, and using time.time(), but apparently js is single threaded so that doesn’t work. Instead, i pregenerated a bunch of values, saved them to a text file and now will cycle through those. Will use random colors or maybe from a list as well. The canvas draw is pretty fast so shouldn’t lag.

NEXT STEPS: Finish changing landing page, Fixed ui on info page, use the main script file, not seperate for info page, little modifications to ui, and auto choose best mask method.

EDIT: Fix the title for Asthetic Settings(shouldn’t be multiLine)

0
Simha Saraswati

Style landing page. Styling done, now just gonna add the changing qr code thing. Thinking of randomizing color, version, mask, and ecc level

Attachment
0
Simha Saraswati

Kept working on the landing page. I’m thinking of having a qr code on the top that keeps changing and the text for the title. Kinda like that stuff in videos where uses different fonts like magazine clippings and stuff quickly on the same text. Idk if that. made sense

Attachment
0
Simha Saraswati

I made it so if you delete all text, it resets to v2 so it doesn’t stay enlarged for really small new text. Idk if that really made sense. Next, the main part, I made everything react native flex mode. I added spacers, Looking at it rn, i can clean it up a bit, i don’t need outer inner to be seperate anymore. gonna do that rn

NEXT STEPS: LANDING PAGE, Fixed ui on info page, little modifications to ui, and auto choose best mask method.

EDIT: Fix the title for Asthetic Settings(shouldn’t be multiLine)

0
Simha Saraswati

Made it auto enlarge the qr code version/lower ecc level if needed. now that i think about it, i should alert for lowering ecc. Also, right now the alert is kinda buggy, but i should add a flag for if its the first alert. I tried also doing the opposite, which is iff you have extra space, make version smaller, and ecc higher, but it got locked because it would try to enlarge ecc, but for that it would go to higher veresion. next steps(i’m sticking to it this time): LANDING PAGE, Fixed ui on info page, little modifications to ui, and auto choose best mask method.

0
Simha Saraswati

I implemented the logic from last dev log, i had the brilliant realization that its a lot like react native so had ai research if it is possible to use same format, turns out it very much is. I told it to generate the css for the container class nad then worked from there. I feel like the settings spacing is still a bit off, might add margin vertical more? idk, just messsing arround with it, butthe other placements are good. REMEMBER TO IMPLEMENT NEW UI ON INFO PAGE

Attachment
Attachment
0
Simha Saraswati

Added Error Correction to the info page, and planned out ui for the main page

Attachment
0
Simha Saraswati

Custom Colors! Also started on info page! ik its probably hella inefficient to have 2 script files, but its fine. I wrote the info for all things, but nobody is reading all that, so i kinda wanna re order so ECC will be at top because its most impressive. Also, nobody is pressing info page link, so i need a landing page. NEXT STEPS: Landing page, UI, and little more on info

0
Simha Saraswati

Logo and download done! download was fairly simple, spent some time on naming of the file, but that was similar to my previous maze project. For logo, i had to figure out how to draw from a file upload, then also the sizing was really important, and i messed around with the formula a lot because you want it to get smaller as the qr code gets bigger. Idk, just asthetics. NEXT STEPS: info page(basic), Landing page(so people actually go to info page), custom colors for qr code(maybe shapes?), UI(use blank space at right instead of cramming everythign to top)

0
Simha Saraswati

Honestly, it’s not great that I keep getting side tracked. I basically fixed the color coding, because before I was using unoffset in writeData. Had to change the function to accept arrays and shit. Basically now u can see padding bytes and it’s really cool to see distribution of data. NEXT STEPS: download logo, info page(overview), logo

0
Simha Saraswati

YESSSS! WORKING! Ohh this has been a long and arduous project, but finally its done! Problem was with versionBits, but not calculation, that was fine. Problem was with display. Idk where i got this notion, but its NOT by rows, its by columns. I used a BUNCH of Ai to figure this out, but then once it worked i understood how simple it was so i reimplemented without AI. Lwk i’m kinda slow. NEXT STEPS: logo in code, download code. Don’t hink i’m gonna do info page

0
Simha Saraswati

Adding this devlog cause its been a substantial time. I think i know why it wasn’t working before. Basically, for versionOffset, the bits 0, 1 become 10, 11, and if you treat it as a string, it will be considered as 1, 0, 1, 1, which was why it was being too long(i think). Fixed by using binary ARRAY instead of string in offsetString. ON THE BRIGHT SIDE: multi block is working. I know because any error correction works for levels up till 6. Problem now is with version info i’m assuming because from 7 onward, its not working. Gonna fix that nad then some QoL features, but lwk tryna wrap this up now

2

Comments

Simha Saraswati
Simha Saraswati 15 days ago

used the https://www.nayuki.io/page/qr-code-generator-library website, my version bits are calculated wrong rn

Simha Saraswati
Simha Saraswati 15 days ago

just checked, everything else is correct, so just need to fix this :(

Simha Saraswati

Lwk reverted to old working commit, then will look at all comits since htem and re ipmlement, looking for errors thorugh out, proper testing basically. Here are the commits:

b49d4d0 offset > 4 doesn’t work, need to use binary array instead of binary string XXXXXXX
dc18855 scope leak
a12ee32 debugging temp XXXXXXX
a12ee32 debugging temp XXXXXXX
aadbac3 problem is in padding bytes XXXXXXX
79a6cde work on out of space XXXXXXX
8c7f72d order getBitStream
f59d9a8 offsetString
aadbac3 problem is in padding bytes XXXXXXX
aadbac3 problem is in padding bytes XXXXXXX
79a6cde work on out of space XXXXXXX
8c7f72d order getBitStream
f59d9a8 offsetString
a9bf6f1 getBitStream function
c4b5c3a terminators and paddingBytes seperate calculation
1bf2626 move error padding to errorCorrection
55497dd move padding to error correciton
968b9a9 2 sizes logic
89c0ff3 better padding logic
989842c split up data bytes correctly
6a5f328 fix +4 issue in messageCoefficients
f5d1341 temp
605fb2c 2 byte text length for v>9
8776a6a organize getErrorLevel
b28efa3 scope issues(let/var/const keywords)

0
Simha Saraswati

Spent a lot of time working on why i’m hitting OUT OF SPACE identifier(idk if i showed this was added last time). Going to go back to other stuff once i figure this out. Just checked, and seems to have correct # padding bytes. AI keeps giving diff answers, but according to my calculations, i think there should be 252 padding bytes, not 270 as the image shows

Attachment
0
Simha Saraswati

Here i’m just showing that theere are more data bits with same text for bigger versions, demonstrating the 2 byte length thing. I also fixed all scope issues. Here’s the annoying part, I just learned that apparently for more than 1 block of error correction, you have to do block0byte0, block1byte0… So now i’m gonna try to writeinto codegrid using messageCoefficients. NEXT STEPS: error correction in blocks(MAIN data from message coefficients), logo in code, info page

0
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
Simha Saraswati about 1 month ago

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 about 2 months ago

didnt know there was so much math involved

Simha Saraswati
Simha Saraswati about 2 months 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

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 3 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 3 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 4 months ago

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

Simha Saraswati
Simha Saraswati 4 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 4 months ago

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

Simha Saraswati
Simha Saraswati 4 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