Browse Search Popular Register Upload Rules User list Login:
Search:
Code Extractor

Image:
screenshot of the scene

Author: s_noonan

Group: Technical

Filesize: 63.19 kB

Date added: 2021-02-28

Rating: 5

Downloads: 400

Views: 178

Comments: 9

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

Extracts custom code added to objects.

Rev A: Now gets "scene.my." functions and variables.
Rev B: Added "Show scene.my" check box.
Last edited at 2021/09/25 12:05:22 by s_noonan
Please log in to rate this scene
edit
Similar scenes
Title: Human Code
Rating: 5
Filesize: 38.83 kB
Downloads: 1162
Comments: 0
Ratings: 1
Date added: 2020/03/28 22:02:57
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Morse Code Machine
Rating: 5.625
Filesize: 231.1 kB
Downloads: 2522
Comments: 4
Ratings: 2
Date added: 2013/07/23 00:14:11
Made with: Algodoo v2.1.0
Rating: rated 5.6
download
Title: Tip up barrel pistol
Rating: 6.1111
Filesize: 71 kB
Downloads: 1083
Comments: 1
Ratings: 3
Date added: 2013/06/04 07:06:48
Made with: Algodoo v2.1.0
Rating: rated 6.1
download
Title: SELF-MODIFYING CODE
Rating: 5.625
Filesize: 16.28 kB
Downloads: 696
Comments: 2
Ratings: 2
Date added: 2013/01/10 07:45:37
Made with: Algodoo v2.0.2 Edu
Rating: rated 5.6
download
Title: Logic Gates
Rating: 5
Filesize: 110.55 kB
Downloads: 694
Comments: 4
Ratings: 1
Date added: 2023/06/24 22:09:14
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: One Hit Wonder
Rating: 5
Filesize: 24.06 kB
Downloads: 512
Comments: 3
Ratings: 1
Date added: 2012/10/21 11:36:14
Made with: Algodoo v2.0.2 Edu
Rating: rated 5
download
Very interesting tool, but I fail to see the usefulness of it. For example, if I want to copy some code in an object, I simply enter the edit menu and copy the desired code. So why would anyone need this?
Here are a few cases where it might be used:
Case 1: Somebody created an interesting scripted scene and you want to know how it works. This tool will show you the scripts, the type of object that has the scripts, and where that object is located.
Case 2: You are developing a scripted scene and the scripts are not working out as intended. This tool allows you to put all the scripts in a single document where it is easier to see the relationship between the scripts.
Case 3: You are developing a scripted scene. This tool allows you to modify the code and then paste it into the script menu edit box allowing you to change multiple variables and functions in one shot.
Case 4: You just created a scripted scene that took you a long time and you are curious as to how many lines of custom code were created to make the scene.
Case 5: You created a scene that has a GUI that controls a machine (or not) and you want to estimate the time and effort to port the GUI to a different programming language.
Case 6: You are new to scripting and want to see just the script and not all the other stuff.

Note: The Code Extractor itself has 749 custom lines of custom code (CLOC). The Chess Match Player scene has 2038 CLOC. Your Tornado scene has 440 CLOC. Matto's ECO localization scene has 10435 CLOC.
Last edited at 2021/03/03 10:25:56 by s_noonan
Okay, fair enough. Now make a tool that exposes any custom code that was entered into the Console (such as "scene.my" functions, arrays, variables and constants). That type of tool would save time and effort over parsing all the code in the Algodoo Config and other include files.
Good idea. I forgot about those.
Quote: "Rev A: Now gets "scene.my." functions and variables."

It doesn't seem to work. As a test I entered a couple of "scene.my" variables into the console, and they did not show along with the other custom code.
Most likely your scene.my variables are dead code. If your scene.my variables are not used anywhere, then they won't show up in the extractor. I was looking for an easy way to list all the scene.my variables but couldn't find one. The extractor finds all the scene.my variables in the code and then evaluates each one.
My bad. I entered and initialized scene.my variables in the console but then did not use them in the actual code. Now when I actually use them, your Code Extractor finds them!

Nice work!

BTW - Have you seen this interesting technical paper: https://mori0091.github.io/Biped/biped6.0.html

It was written by Algodoo user mori-d (an expert on leg and foot mechanics).
Thanks for the link to the paper. Mori-d does some impressive work.

I noticed that my code extractor is very slow for big files. I'm working on a faster version.
Back in the mid 1980's I wrote Assembler language code for the 8-bit Intel 8085A uP. It doesn't get any faster than that! But, unfortunately, all we have now in Algodoo is TIME (pun intended). :lol: