joereddington / MrsLandingham

An exercise in working out what my workflow actually is.
0 stars 1 forks source link

Write/Read workflow from file #22

Open joereddington opened 6 years ago

joereddington commented 6 years ago

I'd like other people to be able to use DELORES and the main step to that is to be able to input/export files.

(We need to think about the possibility of a 'jump node' first to solve the 'else branch' issue (but only for reading). We've worked out how we want to lay out our JSON at least.

joereddington commented 6 years ago
11/12/17 21:01:

I'm doing to do a signiticant extension of DELORES tonight. Including sound effects and a range of other bits of code. Let's make it work.

21:03:

Let's start with the sound effects.

SAS: find the sound effects.

21:09:

I've found and copied over the sound effects.

21:13:

I've replaced the sounds, let's see if it works (I think I've fixed the 'running out of time' bug as well...o

21:13:

Mayby not, might have frozen... o

21:14:

Air sound works (when I remember to, you know, swtich sounds on) Will wait for the others while I look at other bits of code.

21:15:

This talks about how to interupt a sound: https://stackoverflow.com/questions/14002510/how-to-cancel-a-playing-sound-started-with-audioservicesplaysystemsound - basically it says to use a difference system...

21:16:

The other thing I could do in this area is get DELORES to remember how long it had been since the last log and give the relevent number of seconds... Or something liek that... o

21:20:

The other sound effect works and we now have negative numbers, NOT exactly what I wanted but it does mean that it's worth commiting. So I have.

21:31:

I'm now about to play with spidering. Because I think I can write the damn algorithm properly... in psudo code Let's see.

21:36:

I wrote a rough spider code.

21:42:

Rough spider works roughtly, Parituclarly for nighttime.

21:47:

Ah - I have a problem that the Ifs aren't aware that they merge later. Hmm. That might be structural.

21:47:

Also I should do something about the expands.

21:51:

I've tried to get the do nodes with expandsions to expand, and I've got the question nodes to say if they are a loop or not...

22:01:

Getting a stange bug...

22:05:

Oh - It's getting caught in an infinate loop... Better cancel the loop bit for now...

22:15:

This is bringing me face to face with some long term issues like 'how to you add nodes to both branches of an if?' 'how do we prevent infinate loops?' and where do we process the nodes themselves...?

22:18:

So. How does the spider notice that it's hit the same node more than once?

Sigh, is that really the best feeling we have? That we name all the nodes and let everything else get sorted out? Later? So how would that work? We'd have a node->id table? Or we'd have a field.

Okay number everything according to it's distance from the root. Then we have solved the if infinate loops - but we have solved the fact that all the multiple choice ones might have the same decendents and that get's boring fast. Unless we make them into: direct calls:

So, what are the problems we are trying to solve?

  1. Have a parsable language we can read it? 1.1 Get the current structures to be able to be output. 1.1.1 Solve the infinate loops involved.

Hang on. Maybe you only need to know if a node has more than one ancestor? Because if it does then it needs to be split off, and if it doesn't then it's fine.

22:26:

No, Naming solves most of our problems: It means that the loops (which are already fine) are fine, the branches are also fine (because we have the else branch done fist and stop the if branch when we see something we know). Does it solve the multiples? Well... If they see something that've seen before, they should actaully simply keep going because that's fine.

22:29:

Unless we have dropthrough nodes for exactly this purpose. They sit in a bubble and get passed though by everything but the description. Might be overly complex if our goal is to read these things.

22:30:

Or we can look at this from the other end: How do we want to write this?

if("is sky blue"): go outside enjoyself while("We are young"): be free followdreams()

22:31:

That's easy, but what does the case statement look like?

if:
"Blue pill" -> be free 
"Red pill" -> terrible_bit_of_redit()

That appears doable.

Here's the thing: it might be easier to write the damn thing and get it parsed.

22:35:

Okay, I think it can go into JSON nicely (each set of statements is a list, a choice is a dictionary, ifs and whiles are, you know, the other one). That makes a number of things easier.

22:36:

Now the question is: Why CAN'T we get things out into JSON, and the answer is the same problem as before - the branch statement doesn't allow... wait... are we simply building a jump node? (it's the same as a fall through node but... different...)

joereddington commented 6 years ago
12/12/17 21:04:

Interesting idea - we can structure the if statement like a while loop - with the last statment of the branch linking to the top node again. That would give us the ability to output the structure better.

We'd need to alter the code in the 'move forward' bit though.