484
Coding chess (startrek.website)
you are viewing a single comment's thread
view the rest of the comments
[-] homura1650@lemm.ee 12 points 9 months ago

Back when I was learning, I made a flashcard program. It had a class that was essentially a constant array, so you could call get(int i), and it would return an object describing both sides of the card.

How did I implement such a class you ask? First, I made a spreadsheet with 2 collumns to hold the data, with a third collumn of incrementing integers. Then, in the 4th column, I used string concatanation to right a java if statement that compared a variable against the index collumn; and if they match, return an object constructed from the 2 data columns.

Click and drag the 1 cell I wrote in the 4th collumn to replicate it in all the rows, then copy and paste the 4th collumn into notepad++.

I'd like to say I've moved past this; but my most successful projects have mostly been code generation ones; so really I've just moved past Excell.

[-] luciferofastora@lemmy.zip 1 points 6 months ago

I mean, moving past Excel is still an excellent development.

Signed, a guy that keeps dealing with people who need my code to spit out weird spreadsheets.

this post was submitted on 29 Jan 2024
484 points (98.4% liked)

AnarchyChess

5163 readers
39 users here now

Holy hell

Other chess communities:
!Chess@lemmy.ml
!chessbeginners@sh.itjust.works

Matrix space

founded 1 year ago
MODERATORS