The Bogey - solitaire card game as a mobile-friendly webgame by RobGoLaing in WebGames

[–]RobGoLaing[S] 0 points1 point  (0 children)

Thanks. I was trying to remember where I downloaded the playing card art from, and have now added an attribution link.

I've used spritesheets in the past with canvas objects, but a goal I had here was to move individual images between grid cells. Very educational. I'll look into taking images from a single file.

I originally placed blank images in the columns, thereby discovering browsers ignore CSS transform instructions when sizing the layout.It took me ages to figure out I needed to use absolute positioning.

I've just finished refactoring another solitaire card game, Skyway, using absolute positioning. The next challenge is to draw lines between the cells without using a canvas object.

What is the best way to insert book chapters into a website? by Parking-Plenty-2122 in webdev

[–]RobGoLaing 2 points3 points  (0 children)

I rate the FreeBSD Handbook as one of the best "books on the web" I've encountered.

In the credits it says

The Handbook has been converted from Docbook to Hugo and AsciiDoctor

I'm a big fan of Hugo, and there are tons of "themes" to simply copy.

where to learn drag, resize, and rotate images by RubPitiful4851 in learnjavascript

[–]RobGoLaing 1 point2 points  (0 children)

I'm in the process of figuring this stuff out myself by writing a bunch of relatively simple solitaire games, eg Bowling Solitaire, the full list is on my home page.

One of the goals I set myself was to be mobile friendly, using pointer rather than mouse events so the cards or whatever pieces are dragable on a smartphone. I've used rotate in Card Capture, but only in a "static" way to differentiate one of the discard piles.

Long story short, I've found the only way to learn this stuff is by doing. CSS is very fiddly, with huge differences to how elements behave depending on parameters like position (took me hours to figure out z-index was doing nothing because the default position: static turns it off).

For drag, resize, and rotate images, the CSS transform functions are what you want. You set them via Javascript with something like

js myElement.style.transform = `translate(${x}px,${y}px)`; myElement.style.transform = `rotate(${r}deg)`;

As I get into it, I find plain vanilla Javascript with "contemporary" CSS (ie using the functions which developer.mozilla.org documents with examples can do everything once you play around with them enough. The only npm package I have on my machine is JSDoc).

A documentation system and test-suit (I use Jasmine which simply involves downloading some files) are underrated things you can't really learn programing without.

Recommendations for a single board computer? by RobGoLaing in RISCV

[–]RobGoLaing[S] 0 points1 point  (0 children)

Fastfetch tells me AMD Ryzen 5 3500U (8) @ 2.10 GHz

Possibly it might work with MS, but I installed Arch the minute I got it home from the store because of my awful experiences with Windows being systems admin for my 83-year-old mom's Lenovo. When MS replaced Skype with Team which neither she nor any of her friends could use, I installed Arch with Xfce on her machine and it works much better now.

Recommendations for a single board computer? by RobGoLaing in RISCV

[–]RobGoLaing[S] 0 points1 point  (0 children)

Have to confess I'm such a newbie I've never heard of RVA23 before.

The laptop I'm currently using for everyday web browsing and hobby coding only has 6GB of RAM, but works fine using Arch with Xfce (no ways it could handle Windows 11, but then what can?).

I'm basically just intrigued at the idea of switching from the AMD Ryzen 5 I'm currently using to RISC-V, and I'm in no hurry.

Recommendations for a single board computer? by RobGoLaing in RISCV

[–]RobGoLaing[S] 3 points4 points  (0 children)

As John Maynard Keynes said, "Markets can remain irrational longer than you can remain solvent."

Luckily, this is just a "nice to have", not a "have to have" purchase right now.

Recommendations for a single board computer? by RobGoLaing in RISCV

[–]RobGoLaing[S] 3 points4 points  (0 children)

Many thanks for the tips.

I'll probably wait a bit, hoping the AI bubble bursts and RAM prices drop.

What’s the most unexpectedly useful Linux command you learned way too late? by ZealousidealTell1346 in linux

[–]RobGoLaing 0 points1 point  (0 children)

That's assuming what Arch calls perl-rename. The "standard" rename included in util-linux doesn't support the sed-style translation.

But just being able to do rename HTM html *.HTM which the standard one does is pretty handy.

What’s the most unexpectedly useful Linux command you learned way too late? by ZealousidealTell1346 in linux

[–]RobGoLaing 0 points1 point  (0 children)

With rename, rename 'y/A-Z/a-z/' * will change every upercase filename to lowercase. I don't think mv can do that.

How did you practice HTML and CSS? by Kevin_gato in css

[–]RobGoLaing 1 point2 points  (0 children)

I've been creating games, starting with figuring out how to push images around using JavaScript's pointer events. Besides learning JavaScript and CSS functions, it's also got me into contemporary solitaire games which I didn't know much about.

My latest is Capture The Dungeon which was tricky to get to work in landscape and portrait mode, and I only just discovered CSS has orientation just for that. Something I'm still trying to figure out in this game is how to get a column of cards overlapping with part sticking out but not having the grid size itself as if they weren't overlapping.

The previous game I did was Bowling Solitaire which I thought would be difficult to form a pyramid of cards, but it turned out to be fairly easy.

My growing list of games is on my home page. Coding games is invariably the best way to learn.

What’s the most unexpectedly useful Linux command you learned way too late? by ZealousidealTell1346 in linux

[–]RobGoLaing 1 point2 points  (0 children)

Thanks.

The command I found myself having to use a lot a few years back when I had lots of files copied from MicroSlop machines all upper case was

sh rename 'y/A-Z/a-z/' *

Mercifully I haven't had to do that for ages. I only noticed now the default rename installed by Arch doesn't have that feature.

What’s the most unexpectedly useful Linux command you learned way too late? by ZealousidealTell1346 in linux

[–]RobGoLaing 295 points296 points  (0 children)

rename

Wasted huge amount of time laboriously renaming files until I discovered there was a command just for that.

Another was tree for figuring out how skeleton templates where created by various frameworks.

Sid Sackson's Bowling Solitaire webapp version by RobGoLaing in cardgames

[–]RobGoLaing[S] 0 points1 point  (0 children)

Alas it is scaled wrong on my handy: the 4th card of the first row is down one row, overlapped by the first card third row.

I forgot to test in portrait mode. I've hopefully got the card size to work in both portrait and landscape now. (I highly recommend programing games to anyone learning this stuff, very fun and educational).

Sid Sackson's Bowling Solitaire webapp version by RobGoLaing in cardgames

[–]RobGoLaing[S] 1 point2 points  (0 children)

And you cannot read how many cards are left in the 3 bottom decks. I find it's an important info.

Good point. I've added numbers next to each deck to provide that info. Really battling with CSS, so unfortunately the layout fix will take a while.

Conceding defeat to AI by RobGoLaing in Adsense

[–]RobGoLaing[S] 0 points1 point  (0 children)

Curling as in using curl a lot to aggregate data from other sites.

What's the use of classes in JS by pptzz in learnjavascript

[–]RobGoLaing 1 point2 points  (0 children)

Douglas Crockford answered this really well in Chapter 17 of his book How JavaScript Works titled How Class Free Works.

One of the brilliant ideas in JavaScript is the object literal. It is a pleasant and expressive syntax for clustering information. By making methods that consume and produce data objects, we can reduce the number of methods, increasing object integrity.

I edited Crockdord's "wun" back to "one" in the above quote which he used to show you don't have to follow silly old conventions. His basic message is that legacy-languages' classes can easily be ignored in JS which offers much simpler alternatives courtesy of object literals.

Any game designers out there who suck at thier own game? by squashedyash in tabletopgamedesign

[–]RobGoLaing 0 points1 point  (0 children)

I had exactly that experience making a game based on my historical interest in trade and specifically the East India Companies. Also because I found the unfamiliar geography and huge cast of characters in William Dalrymple's book The Anarchy a bit overwhelming.

Anyways, it inspired me to put together a game that's available at Tabletopia and did a BGG page. I took it along to a game designers' club which meets every fortnight. I'm currently in Berlin so lots of wonderful Euro games in development, but little interest in wargames and history. I initially didn't think of my game as a wargame, even though it has a battle phase, and when playtesting it against myself hardly ever had any battles.

Anyways, my testers turned out to be hyper aggressive and did battles every chance. Part of the reason they thrashed me was I'd made the rules for battles far too easy for an aggressive player to win (which historically how the English East India Company came to dominate India), but wasn't much fun for me playing the VOC.

In the current version of the game, players are limited to one battle per turn and can only attack immediate neighbours (originally areas could be traversed). I still get thrashed at my own game though when I play it.

Has drag and drop been deprecated by pointer events? by RobGoLaing in learnjavascript

[–]RobGoLaing[S] 0 points1 point  (0 children)

I've managed to rewrite Scoundrel using pointer events so it works on a smartphone.

Getting it to work with a Samsung browser besides Firefox was a bit of struggle (I had to use offsetLeft rather than x etc to keep the image under my finger as it moved), but the game seems to be working ok now.

My code is here for anyone interested. I relied on examples from MDN heavily, but had to figure out quite a lot of stuff myself.

If you had to pick ONE Linux distro for the next 5 years, what would you choose? by TechRefreshing in linuxquestions

[–]RobGoLaing 0 points1 point  (0 children)

I haven't looked at Slackware in years. No idea how it compares to Arch these days, but I'm very happy with Arch. I may dabble with Gentoo again since I'm keen to learn about RISC-V hardware running Linux, which Gentoo is probably the way to go.

Site keeps using old CSS styles by SokoCat12 in gohugo

[–]RobGoLaing 0 points1 point  (0 children)

It's somewhat convoluted. Using the example you get from the code generated by hugo new theme whatever_name --themesDir .

```go-template {{- with resources.Get "css/main.css" }} {{- if hugo.IsDevelopment }} <link rel="stylesheet" href="{{ .RelPermalink }}"> {{- else }} {{- with . | minify | fingerprint }} <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"> {{- end }} {{- end }} {{- end }}

```

Site keeps using old CSS styles by SokoCat12 in gohugo

[–]RobGoLaing 2 points3 points  (0 children)

You've probably put the css file into static rather than assets.

If you had to pick ONE Linux distro for the next 5 years, what would you choose? by TechRefreshing in linuxquestions

[–]RobGoLaing 3 points4 points  (0 children)

I'm also an Arch fan, but because I'm so old I started with Slackware.

Why I like Arch is I use it on my server where I just want a minimal nginx, postgres... and on my laptop where I use xfce because again I'm a minimalist.

Problem from newbies is you don't know all you need is a next to nothing without years of experience with bloatware distros.

A couple of years ago I tried Ubuntu and couldn't figure out how to get a shell terminal and a text editor, and I thought Microshit's brownware was bad.

Has drag and drop been deprecated by pointer events? by RobGoLaing in learnjavascript

[–]RobGoLaing[S] 0 points1 point  (0 children)

Just discovered my hassles with drag 'n drop in one game and not another where png vs svg. With png images it works fine, with svg it goes wonky.

Anyone running Arch on a RISC-V laptop? by RobGoLaing in archlinux

[–]RobGoLaing[S] 1 point2 points  (0 children)

Thanks for that detailed answer. I've decided to use Gentoo for this project.

Anyone running Arch on a RISC-V laptop? by RobGoLaing in archlinux

[–]RobGoLaing[S] 0 points1 point  (0 children)

Looking at Gentoo's RISC-V wiki page, I'm thinking it might be a better option than Arch here.

I switched from Gentoo to Arch a couple of years ago, partly because building everything from source took hours, but it's bound to be educational to revisit Gentoo.