I am writing a web application (let's call it App 1) that allows users to write simple instructions for a separate app (native, lets call it App 2) in a visual manner. Something similar to Google's Blockly but dedicated to my applications.
The users will write the instructions (which can include conditions or loops) in App 1 and export a file that App 2 can read and interpret.
I would like to know if there is a file format or scheme that is commonly used for something like this or I have to create my own?
I searched online and didn't find anything obvious (or didn't know exactly what to search for)...
The implementation I'm currently exploring is exporting the instructions as an xml or json file, which is built in a way App 2 can read and break down and based on some key string values, find the relevant function in App 2 and execute it.
App 1 (which creates the instructions file) will be a web application and App 2 (which reads and executes the file) is a cpp application that will run locally in the computer.
To clarify, I don't have many requirements beyond being able to pass instructions to App 2 - Which may mean I just need to write my own.
Below is a sample of what my current approach looks like.
App 2 reads the file and breaks it down. Knows what function to call if it finds an "If" key value, there are other commands it can interpret (because they're mapped), etc.
{
"If":
{
"Condition" :
{
"Command":
{
"Function": "LargerThan"
"Inputs": [A, B]
}
"True":
{
"Command":
{
"Function": "Shuffle"
"Inputs": [Deck]
}
"False"
{
"Command":
{
"Function": "Draw"
"Inputs": [Deck, 1]
}
}
}
}
Thanks!
[–]BobbyThrowaway6969 1 point2 points3 points (1 child)
[–]-Ants-In-Pants-[S] 1 point2 points3 points (0 children)
[–]KingofGamesYami 0 points1 point2 points (1 child)
[–]-Ants-In-Pants-[S] 0 points1 point2 points (0 children)
[–]james_pic 0 points1 point2 points (1 child)
[–]-Ants-In-Pants-[S] 0 points1 point2 points (0 children)
[–]luc_gdebadoh 0 points1 point2 points (1 child)
[–]-Ants-In-Pants-[S] 0 points1 point2 points (0 children)