Toasted on a grid iron
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Toasted on a grid iron
I was fairly cheesed-off today when someone suggested that to generate a square, random map
would be long and difficult, if not impossible in LiveCode.
-
would be long and difficult, if not impossible in LiveCode.
-
- Attachments
-
- Robot Test1.livecode.zip
- Here's the stack.
- (3.87 KiB) Downloaded 183 times
-
- VIP Livecode Opensource Backer
- Posts: 9657
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Toasted on a grid iron
Richmond.
I agree, LC eats this for lunch.
But for dinner, you need to make the finished product symmetrical about the diagonals, or you do not get a crossword blank slate.
Craig
I agree, LC eats this for lunch.
But for dinner, you need to make the finished product symmetrical about the diagonals, or you do not get a crossword blank slate.
Craig
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Toasted on a grid iron
Why does a crossword blank have to be symmetrical about a diagonal?
The story behind this stack is that, today, as I was leaving my school, having taught 2 classes about LiveCode my intern, who is halfway through her bachelor's degree at Plovdiv University in Computer Programming started making objections when I suggested one of the best ways to get to grips with LiveCode was to duplicate projects given to her by her lecturers at the Uni' for C++, C#, Java and so on in LiveCode.
She then told me about a machine-learning 'thing' where a "robot" has to traverse a square grid where 25% of the squares are 'traps', and the robot should 'learn' by its mistakes . . . and said she didn't think that was possible in LiveCode.
So this grid generator is the start of my attempt to go "nyah, nyah, nyah" to her.
The story behind this stack is that, today, as I was leaving my school, having taught 2 classes about LiveCode my intern, who is halfway through her bachelor's degree at Plovdiv University in Computer Programming started making objections when I suggested one of the best ways to get to grips with LiveCode was to duplicate projects given to her by her lecturers at the Uni' for C++, C#, Java and so on in LiveCode.
She then told me about a machine-learning 'thing' where a "robot" has to traverse a square grid where 25% of the squares are 'traps', and the robot should 'learn' by its mistakes . . . and said she didn't think that was possible in LiveCode.
So this grid generator is the start of my attempt to go "nyah, nyah, nyah" to her.
-
- VIP Livecode Opensource Backer
- Posts: 9657
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Toasted on a grid iron
Richmond.
Go get 'em.
It is not a law, but at least here crosswords are always so constructed. That is not to say that intentional oddities do not exist.
For your purposes, it is not pertinent.
Craig
Go get 'em.
It is not a law, but at least here crosswords are always so constructed. That is not to say that intentional oddities do not exist.
For your purposes, it is not pertinent.
Craig
Re: Toasted on a grid iron
Your mention of the machine learning problem in these old posts sparked my interest so I decided to try it out as a beginners project to stimulate my old brain. So here is what I came up with:
You can show your intern that LiveCode isn't entirely a 90 pound weakling even in the machine learning area even in the hands of a beginner!
Kelly
ps The grid took 12 lines of code and the barriers took another 14. Not difficult at all. The stack overall has 340 lines of code - most of it in the search and weighting behaviours.
The maze can be resized but the mouse always starts at the top left and the cheese is always at the bottom right. The 25% barriers change each time. I decided that the mouse can see 2 squares ahead but could smell that cheese down and to the right, so my decision weightings each move favoured those directions unless the mouse was caught in a dead end and had to back track. The mouse can move on diagonals because it can squeeze through the gaps between the barriers.You can show your intern that LiveCode isn't entirely a 90 pound weakling even in the machine learning area even in the hands of a beginner!
Kelly
ps The grid took 12 lines of code and the barriers took another 14. Not difficult at all. The stack overall has 340 lines of code - most of it in the search and weighting behaviours.
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Toasted on a grid iron
Wow; dunbar, kdjanz's new post made me remember your lovely description of me:
Outwith the USA we are not quite so worried about symmetry, and, while I'm here I cannot resist a wee jab at the USA:
Frankly, your current President is looking increasingly asymmetrical.
intentional oddities
Outwith the USA we are not quite so worried about symmetry, and, while I'm here I cannot resist a wee jab at the USA:
Frankly, your current President is looking increasingly asymmetrical.
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Toasted on a grid iron
Machine learning is perfectly doable in Livecode; after all, ALL that machine learning really is
is pushing a choice decision that has been taken before over one that hasn't.
If the cat prefers "Super Kitten" for breakfast, having offered her the choice of "Fun Cat" & "Super Kitten" yesterday, I probably
will just plonk "Super Kitten" in her bowl and not bother to give her a choice again between that and "Fun Cat" again.
is pushing a choice decision that has been taken before over one that hasn't.
If the cat prefers "Super Kitten" for breakfast, having offered her the choice of "Fun Cat" & "Super Kitten" yesterday, I probably
will just plonk "Super Kitten" in her bowl and not bother to give her a choice again between that and "Fun Cat" again.
-
- VIP Livecode Opensource Backer
- Posts: 9833
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Toasted on a grid iron
Back in the '90s I made a maze learner in SuperCard. It was similar in some respects to what you described: it would keep track of branches it went down, and if it found a dead end it would back up to the nearest juncture and try another path, avoiding known deadends as it went.richmond62 wrote: ↑Wed May 20, 2020 10:28 amMachine learning is perfectly doable in Livecode; after all, ALL that machine learning really is
is pushing a choice decision that has been taken before over one that hasn't.
You're right: it wasn't much code. Nor very sophisticated. Just text lists of graphic object numbers, updated as it goes. IIRC I even had a window titled "Brain" where you could watch the lists update on real time.
I'm not sure where that project file is, but I'm fairly certain it's in my archives. I could pull the scripts out easily enough, but I'm not sure my copy of SuperCard still runs, so I'd probably have to rebuild it. And that wouldn't be so bad, because there are enough differences between old SC and new LC that it would likely need some revision, and I generally don't like any code I've written more than ten years ago anyway.
All that's a long-winded way is saying I'm not sure if/when I'll have time to post a usable version, and it doesn't really matter; the main point of this reply is just to offer encouragement for the task. When the task isn't exactly climate modeling, your friend is indeed wrong. These things are a snap to build in a high-level GUI like LiveCode.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Toasted on a grid iron
It was a significant learning experience for me! I ended up re-coding it 3X as I changed the data structure and logic. But the whole goal of LiveCode for me is to stretch the brain and keep it active- success for this project!These things are a snap to build in a high-level GUI like LiveCode.
Don’t know what is going to be next.
Kelly