Showing posts with label AI. Show all posts
Showing posts with label AI. Show all posts

Wednesday, 18 January 2023

ChatGPT Poetry

I've had a play with ChatGPT, completely away from asking it to write or improve code snippets I asked it to generate some poetry...

Could you tell me a poem in the style of Wilfred Owen but about Strawberries and Skunks?

And here's the reply....

The strawberry fields, so red and sweet,
Are guarded by the skunk, so discreet.
He sprays his scent with such disdain,
To keep the birds and beasts at bay.

But man, with greed in heart and mind,
Does not let the skunk's defense bind.
He steals the fruit, so plump and ripe,
And leaves the skunk with nought but spite.

But in the end, the skunk prevails,
For though the berries may be hailed,
The smell of skunk, it lingers still,
And serves to remind us of our ill.

So let us honor the skunk's defense,
And give the strawberries their due recompense.
For in this balance, all is fair,
And all may share the bountiful air.

Friday, 25 May 2018

Is Alexa Illegally Wire Tapping Now?

My post about Google doing this was quite popular, today however the BBC have utterly trumped that measly post with this revelation...

Thursday, 17 May 2018

Google Illegal Wire Tapping?

I find this truly disturbing...


I have literally just disabled my microphone.

Thursday, 9 April 2015

Dungeon Crawler - 2D Path Finding

I've had to create a test-bed piece of code for the path finding, so this means there's been no changes to the game side of the code, all the work I've been doing on things over the last couple of days has been about the path finding and it's been in this test-bed application.


So, the application lets me see the grid (or graph if you're a mathematician), I can select the start point, the end point, set blocked grids and then ask it to calculate a route.

The algorithm I've used is an A* algorithm, but a greedy one, and then I've added back-tracing to allow it to get out of dead-ends (such as in a room with a narrow opening) and finally added simplification to the end result route.

The calculation of the route and back tracing is automatic, the simplification however, I've made a manual operation, so I can see how the routes come out of A* before I alter the list of plotted points.

Without the back tracing this is how it could get stuck:


And now, it back traces to the next best nearest grid point to continue the route without getting stuck or going over the points it's already found got it stuck:


And finally, I can apply a simplification to that solution:


I'm now pushing it further, asking the test-bed to work it's way around simple dungeon style rooms, here we see the route from inside one room, down a set of halls and into a cell within another area...


Simplify this result:


And it's quite neat.

The test-bed needs some more features, such as loading/saving the background blocks, making the start of a rudimentary map editor!

Once I'm more happy with the algorithms and heuristics I'm using, then I'll start to tidy the code and then port it into classes for use in the Dungeon game... And finally I'll start to make the movement routines take the list of points to go between...

Note: Since writing this draft, I've continued the work and testing... Only to find a strange problem, which was working, but I've somehow broke, here we see a grid... The Route can continue, but it just stops...




Hmmm, what have I done wrong?


-- Addition --

Since posting this last night at half six, I worked out the bug resulting in this dead end problem above, here's the result now:


Then simplification run on this route:


The challenge now is to simplify, clean up and better document this code.  Then to port it to clear easy to maintain C++