Improving your code development skills

User avatar
Grey
Posts: 2003
Joined: Wed Jul 22, 2020 12:33 am
Location: Russia
Has thanked: 75 times
Been thanked: 365 times

Can you beat 1024 bytes of JavaScript?

Post by Grey »

@wiak and all who are interested, try playing at your leisure.
The Kilobyte's Gambit.
It is a 1 kilobyte CGA style browser chess program.

Matt Round, the author of a very strange site (VOLEwtf) about all sorts of things (extraordinary) made a chess program.
This is an unusual browser-based art adaptation of Oscar Toledo's Toledo Atomchess chess program.
Matt once came across a CGA sketch by pixel artist Pinot about a hypothetical chess program based on the drama miniseries The Queen's Gambit. The combination of Atomchess with sketches resulted in The Kilobyte's Gambit.

A distinctive feature is its diminutiveness - the whole game takes up a kilobyte of code (and this is not the limit - the version for MS-DOS takes only 392 bytes). The program knows very well what "En passant" is.

I think you will win easily. But... that terrifying, soulful gaze of Beth Harmon... :)

The Kilobyte's Gambit.gif
The Kilobyte's Gambit.gif (103.95 KiB) Viewed 1553 times

Fossapup OS, Ryzen 5 3600 CPU, 64 GB RAM, GeForce GTX 1050 Ti 4 GB, Sound Blaster Audigy Rx with amplifier + Yamaha speakers for loud sound, USB Sound Blaster X-Fi Surround 5.1 Pro V3 + headphones for quiet sound.

User avatar
misko_2083
Posts: 196
Joined: Wed Dec 09, 2020 11:59 pm
Has thanked: 10 times
Been thanked: 20 times

Re: Improving your code development skills

Post by misko_2083 »

1kb but a tough little script. :thumbup2:
However I don't play so often, haven't played in years.
Had to make sacrifices to win.

Do you want to exit the Circus? The Harsh Truth
https://www.youtube.com/watch?v=ZJwQicZHp_c

User avatar
misko_2083
Posts: 196
Joined: Wed Dec 09, 2020 11:59 pm
Has thanked: 10 times
Been thanked: 20 times

Re: Improving your code development skills

Post by misko_2083 »

Okay, it's starting to slowly come back to me.
It's no longer a chalenge, stil it's fascinating how basic chess logic fits into 1KB.
I've came up with a conclusion that playing chess doesn't improve development skills, improves only chess skills. :lol:

Do you want to exit the Circus? The Harsh Truth
https://www.youtube.com/watch?v=ZJwQicZHp_c

User avatar
Grey
Posts: 2003
Joined: Wed Jul 22, 2020 12:33 am
Location: Russia
Has thanked: 75 times
Been thanked: 365 times

Re: Can you beat 1024 bytes of JavaScript?

Post by Grey »

Grey wrote: Sat Nov 06, 2021 8:10 am

based on the drama miniseries https://en.wikipedia.org/wiki/The_Queen ... iniseries)

I liked this miniseries. One of the few decent series in recent times.

Firstly, they did not "drag out" the storyline for a long time. Brevity is the sister of talent, the saying tells us.

Secondly, people in the USSR are shown not as monsters, but quite human. There is a moment with a boy and vodka... but there is NO such thing as "klyukva" ("cranberries") - bears, balalaika, gypsies, Kalashnikov assault rifle in the hands of every person in the frame :)

A good movie :thumbup:

Fossapup OS, Ryzen 5 3600 CPU, 64 GB RAM, GeForce GTX 1050 Ti 4 GB, Sound Blaster Audigy Rx with amplifier + Yamaha speakers for loud sound, USB Sound Blaster X-Fi Surround 5.1 Pro V3 + headphones for quiet sound.

User avatar
wiak
Posts: 3673
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 57 times
Been thanked: 1028 times
Contact:

Re: Improving your code development skills

Post by wiak »

CGA graphics is a bit too advanced for me, and Javascript underneath makes that code size far too huge in overall reality.

The following is the one I used to use back sometime around 1979 (but was on a Compukit UK101 despite the following page suggesting the author didn't manage to get it working on that. The link below even gives a version of the source code (it is in 6502 assembly language - so lovely... I myself programmed in that and also UK101 BASIC, by early microsoft I think, back then). Warning - it is a totally crap chess program - it will take your king if you let it and doesn't know en passant or how to castle as far as I remember - anyway, you can improve your code development skills by fixing these irrelevant shortcomings:

http://retro.hansotten.nl/6502-sbc/lee- ... icrochess/

Later I programmed a TCP/IP protocol analyser that caught Vsat data (i.e. TCP/IP over small aperture satellite disk link) and 'analysed' the TCP/IP protocol info. That had to be done in real time, but I managed that using X86 assembly language compiled on an old i386 computer, so could probably manage to rewrite this 6502-based program in X86 for your PC. That would become the boot init for your PC and of course be the fastest init around - far faster than anything even compiled from C - but drawback is that your new 'Pup' would only be able to play crap chess, so not very flexible at all sorry.

That's not a joke, by the way - that was one 'issue' with my 'protocol analyser' program. If you ran it, it took over all computer resources so made a dedicated to purpose machine. i.e. process ID number 1 was the only process running, but great for 'real time' use (it wasn't Linux of course - the program was the OS). Yeah, for 'simplicity', I exaggerate more than a bit, but in theory you could start the whole thing off from CPU first machine code instruction fetch line.

wiak

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
Grey
Posts: 2003
Joined: Wed Jul 22, 2020 12:33 am
Location: Russia
Has thanked: 75 times
Been thanked: 365 times

Re: Improving your code development skills

Post by Grey »

wiak wrote: Wed Dec 01, 2021 8:26 am

CGA graphics is a bit too advanced for me, and Javascript underneath makes that code size far too huge in overall reality.

The following is the one I used to use back sometime around 1979 (but was on a Compukit UK101 despite the following page suggesting the author didn't manage to get it working on that. The link below even gives a version of the source code (it is in 6502 assembly language - so lovely... I myself programmed in that and also UK101 BASIC, by early microsoft I think, back then). Warning - it is a totally crap chess program - it will take your king if you let it and doesn't know en passant or how to castle as far as I remember - anyway, you can improve your code development skills by fixing these irrelevant shortcomings:

http://retro.hansotten.nl/6502-sbc/lee- ... icrochess/

I took the 6502 Simulator from Daryl. Then I launched it using WIne in Fossapup. Compiled the MicroChess source code.

It is started and debugged. Interesting. But I felt like a "museum exhibit" from a Historical Museum. Or an old coat in the closet smelling of mothballs (naphthalene) :D

CGA looks just like a "young handsome" in comparison :)

6502 Sim and MicroChess.gif
6502 Sim and MicroChess.gif (131.47 KiB) Viewed 1386 times

Fossapup OS, Ryzen 5 3600 CPU, 64 GB RAM, GeForce GTX 1050 Ti 4 GB, Sound Blaster Audigy Rx with amplifier + Yamaha speakers for loud sound, USB Sound Blaster X-Fi Surround 5.1 Pro V3 + headphones for quiet sound.

User avatar
wiak
Posts: 3673
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 57 times
Been thanked: 1028 times
Contact:

Re: Improving your code development skills

Post by wiak »

yes, microchess is flipping awful, but I suppose, for its day... still flipping awful

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
Grey
Posts: 2003
Joined: Wed Jul 22, 2020 12:33 am
Location: Russia
Has thanked: 75 times
Been thanked: 365 times

The Price of Victory

Post by Grey »

So, Norwegian grandmaster Magnus Carlsen defeated Russian Ian Nepomniachtchi in the match for the World chess crown and defended the title of world champion. Congratulations to Magnus!

There is also a funny and interesting moment in this story. A Russian porn actress from St. Petersburg, nicknamed Mihanika, promised Ian a "royal night of love." But only if he becomes a world chess champion :D He lost and the night of love probably won't get him :)

The inscription reads: "Ian, if you win, I will be your queen for the whole night!"
Image

Fossapup OS, Ryzen 5 3600 CPU, 64 GB RAM, GeForce GTX 1050 Ti 4 GB, Sound Blaster Audigy Rx with amplifier + Yamaha speakers for loud sound, USB Sound Blaster X-Fi Surround 5.1 Pro V3 + headphones for quiet sound.

Clarity
Posts: 3351
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1382 times
Been thanked: 444 times

Re: Improving your code development skills

Post by Clarity »

Ha! If he had won, would his objective for winning had been "He won for the 'TITle' or won for the 'Prize'!" :?: :)

User avatar
Grey
Posts: 2003
Joined: Wed Jul 22, 2020 12:33 am
Location: Russia
Has thanked: 75 times
Been thanked: 365 times

Re: Improving your code development skills

Post by Grey »

Clarity wrote: Fri Dec 10, 2021 10:48 pm

Ha! If he had won, would his objective for winning had been "He won for the 'TITle' or won for the 'Prize'!" :?: :)

I'm more interested in another question :) Do porn actresses like chess or prizes more?

Fossapup OS, Ryzen 5 3600 CPU, 64 GB RAM, GeForce GTX 1050 Ti 4 GB, Sound Blaster Audigy Rx with amplifier + Yamaha speakers for loud sound, USB Sound Blaster X-Fi Surround 5.1 Pro V3 + headphones for quiet sound.

User avatar
wiak
Posts: 3673
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 57 times
Been thanked: 1028 times
Contact:

Re: Improving your code development skills

Post by wiak »

Grey wrote: Sat Dec 11, 2021 7:32 pm
Clarity wrote: Fri Dec 10, 2021 10:48 pm

Ha! If he had won, would his objective for winning had been "He won for the 'TITle' or won for the 'Prize'!" :?: :)

I'm more interested in another question :) Do porn actresses like chess or prizes more?

I'm more interested to know if that Russian porn actress is particularly attracted to anyone who plays chess or would table-football do? I am preparing to challenge Magnus.

I was table-football champion for a while at the Scottish university I studied at. The prizes were generally bottles of whisky (actually).

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
6502coder
Posts: 89
Joined: Mon Jul 13, 2020 6:21 pm
Location: Western US
Has thanked: 3 times
Been thanked: 20 times

Re: Improving your code development skills

Post by 6502coder »

For big money and hot girls, chess pales in comparison to poker, IMO. That's why chess players switch to poker: Dan Harrington and Howard Lederer, for instance. Daniel Negreanu is a rare counter-example of a top poker player taking up chess.

User avatar
wizard
Posts: 1651
Joined: Sun Aug 09, 2020 7:50 pm
Has thanked: 2203 times
Been thanked: 515 times

Re: Improving your code development skills

Post by wizard »

moved to programing topic

wizard

Last edited by wizard on Fri Dec 17, 2021 2:20 am, edited 1 time in total.

Big pile of OLD computers

User avatar
wiak
Posts: 3673
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 57 times
Been thanked: 1028 times
Contact:

Re: Improving your code development skills

Post by wiak »

wizard wrote: Thu Dec 16, 2021 11:25 pm

Writing some shell scripts in fossa64 9.5 I find I could use xdialog, gtkdialog or yad. Are there reasons to use one vs another?

wizard

This is off-topic area, so usual off-topic joke-type nonsense discussed here. I'd advise you to re-post that question to main forum under Programming area or not many may notice it. It is very arguable indeed that any other of the games and so on discussed in this thread really have any effect on your code developing skills, though you never know...

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

ozsouth
Posts: 1397
Joined: Sun Jul 12, 2020 2:38 am
Location: S.E. Australia
Has thanked: 213 times
Been thanked: 614 times

Re: Improving your code development skills

Post by ozsouth »

Took 5 goes, but I won one.

whitewins.jpg
whitewins.jpg (122.45 KiB) Viewed 991 times
User avatar
rockedge
Site Admin
Posts: 5825
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2077 times
Been thanked: 2172 times
Contact:

Re: Improving your code development skills

Post by rockedge »

Inspired by @ozsouth 's winning I went to play some chess with an eBoard on the freechess.org servers and I was beaten repeatedly in Blitz Chess.......I mean destroyed.....and going for casual players as opponents did not improve my record.

Screenshot(63).jpg
Screenshot(63).jpg (32.52 KiB) Viewed 957 times

So I played the Sjeng engine on easiest....and looked good for a moment...then one move I thought was okay.......and I lost.

No wonder I can not get Grub4Dos to work on KLV-Spectr-RT :geek:

Clarity
Posts: 3351
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1382 times
Been thanked: 444 times

Re: Improving your code development skills

Post by Clarity »

NOt since @tazoc made available the Checkers Game on the old forum, have I seen a PET for the new forum distros. Anyone know how to get one (or it) for today's use?

I have always been much more competitive on this board layout. Although average (maybe) at Chess, I do better at Checkers.

@rockedge, I laughed at the grub4dos comparison. That comedy caught me off-guard. Thanks, we need much more comedics in our lives. Again, now that I stopped laughing...THANKS!

ozsouth
Posts: 1397
Joined: Sun Jul 12, 2020 2:38 am
Location: S.E. Australia
Has thanked: 213 times
Been thanked: 614 times

Re: Improving your code development skills

Post by ozsouth »

@rockedge - 10 tries using sjeng (with move timer 0); I couldn't even manage a stalemate.

User avatar
Grey
Posts: 2003
Joined: Wed Jul 22, 2020 12:33 am
Location: Russia
Has thanked: 75 times
Been thanked: 365 times

Re: Improving your code development skills

Post by Grey »

rockedge wrote: Sat Nov 25, 2023 4:15 pm

...then one move I thought was okay.......and I lost.

We celebrate the City Day here every year in September. Often this holiday coincides with my birthday. On this day, a chess tournament for everyone takes place in the city park of culture and recreation.

So this September I was defeated by one student. He gave me such a gift for my birthday :) I was in shock :shock: for three days - how could any student there... On the fourth day, I found the strength and admitted that the student was just lucky, and I'm still as cool as before :D

Such events allow me to remain realistic. A dreamer, but a realist.
I suspect that next year will be even worse :) Schoolchildren come to the tournament :lol:

Fossapup OS, Ryzen 5 3600 CPU, 64 GB RAM, GeForce GTX 1050 Ti 4 GB, Sound Blaster Audigy Rx with amplifier + Yamaha speakers for loud sound, USB Sound Blaster X-Fi Surround 5.1 Pro V3 + headphones for quiet sound.

User avatar
greengeek
Posts: 1215
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 349 times
Been thanked: 146 times

Re: Improving your code development skills

Post by greengeek »

Clarity wrote: Sun Nov 26, 2023 1:20 am

NOt since @tazoc made available the Checkers Game on the old forum, have I seen a PET for the new forum distros. Anyone know how to get one (or it) for today's use?

Are you able to find any link to that version on the old forum? I see some links to Chinese Checkers - is that what you were after?

ozsouth
Posts: 1397
Joined: Sun Jul 12, 2020 2:38 am
Location: S.E. Australia
Has thanked: 213 times
Been thanked: 614 times

Re: Improving your code development skills

Post by ozsouth »

@greengeek - I think what we call 'Draughts' is 'Checkers' to a North America person. I had a fltk version of that years ago. Not sure it would run in today's pups. Website https://cardgames.io has many of these type of games (including chess & 'checkers'!). Sorry - a bit off-topic.
Later: I beat hard chess opponent again (in cardgames.io). 2nd time in over 200 tries.
.

beat_hard_chess_cardgames.io.jpg
beat_hard_chess_cardgames.io.jpg (21.85 KiB) Viewed 748 times
Last edited by ozsouth on Tue Nov 28, 2023 12:20 pm, edited 1 time in total.
User avatar
wiak
Posts: 3673
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 57 times
Been thanked: 1028 times
Contact:

Re: Can you beat 1024 bytes of JavaScript?

Post by wiak »

Grey wrote: Sat Nov 06, 2021 8:10 am

@wiak and all who are interested, try playing at your leisure.
The Kilobyte's Gambit.
It is a 1 kilobyte CGA style browser chess program.

Matt Round, the author of a very strange site (VOLEwtf) about all sorts of things (extraordinary) made a chess program.
This is an unusual browser-based art adaptation of Oscar Toledo's Toledo Atomchess chess program.
Matt once came across a CGA sketch by pixel artist Pinot about a hypothetical chess program based on the drama miniseries The Queen's Gambit. The combination of Atomchess with sketches resulted in The Kilobyte's Gambit.

A distinctive feature is its diminutiveness - the whole game takes up a kilobyte of code (and this is not the limit - the version for MS-DOS takes only 392 bytes). The program knows very well what "En passant" is.

I think you will win easily. But... that terrifying, soulful gaze of Beth Harmon... :)
The Kilobyte's Gambit.gif

Ok, it was fun to play. King pawn opening and vole, black, started advancing rookside pawns towards my kingside pretty early. I just developed pieces and headed round the back of his attack via centre push and got his king trapped in the middle facing devastating attack...... I also castled queenside putting my two rooks in the centre whilst continuing to push my central pawns forward. It didn't blunder but destroyed it anyway. Good for easy practice though.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

Post Reply

Return to “Off-Topic Area”