Jump to content

Pseudocode


Info
 Share

Recommended Posts

  • Moderators

Info,

Often, but not always - it depends a lot on the size and complexity of the project.

I more frequently use pseudo-code to tidy up once the script is running - when I look back and see that I have written some awful "spaghetti" code. Or to clear my mind about a complicated section before I start to code - although this is not always as successful as I might wish! :unsure:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Pseudocode is not a bad thing, but I don't like the syntax we have to use in university. For private purpose I like using a BASIC / AutoIt-based syntax for pseudocode (including classes, namespaces ... if necessary)

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

  • 2 weeks later...

I generally use Pseudocode to describe what I want to do before I get into the detail for a complex method or class. I find I use A3 paper and a pacer more then then the computer to do it though.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

I usually have the full picture of what I want to do and how to do it before I start doing it. Not being a programmer and not coding anything terribly complicated ever, I have had no need to write ideas or pseudo code to paper/solid_media. I run pseudocode in my head :unsure: .

Even though I can imagine situations when writing it down would be more than necessary.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Here's some of my pseudo code (unedited). It's about as obfuscated as it gets.

"(?i)[012345679abcdefgijmnorstux ºØ^#/\^\+\-]"

Root Notes
[CDEFGAB] ([CDEFGAB][#|b]) [DEGAB]bb [CDFGA]X

BAD PATTERNS "s"
#s  bs  as  /s  ms
"(m[^a])"..s  11..s  s..s  im7..s  º7..s  Ø..s

RETURN VALUES "s"
sus

BAD PATTERNS "d"
+d  -d  #d  bd  ºd "(º[^7])"d
Ø..d  g..d  im..d  º..d

RETURN VALUES "d"
ad = Add  º7d = º7dim3  im7d = im7dim3  d = dim /d = /D

BAD PATTERNS "º"
+d  -d  #d  bd  ºd "(º[^7])"d
Ø..d  g..d  im..d  º..d

BAD PATTERNS "a"
#a  ba

RETURN VALUES "a" If letter /[a-g]
/a = /A

GOOD PATTERNS "[ijn]"
mi  in  maj

BAD PATTERNS "i"
mmi

GOOD PATTERNS "o"
no  jo  [\d+-gs(im)]o OR If Stringlen > 4 Return omit

GOOD PATTERNS "u"
au

BAD PATTERNS "u"
mau  º..au  Ø..au [A[º|Ø]]..au must test for a first => not allow this (dd)

GOOD PATTERNS "m"
\Am|mm rm inm im

GOOD PATTERNS "[cefg]"
/"[cefg]"

BAD PATTERNS b alt
bb  [^m]ab #b +b -b Øb

BAD PATTERNS # alt
b#  [^m]a# ## +# -# Ø#

BAD PATTERNS + alt
b+  [^m]a+ #+ ++ -+ Ø+

BAD PATTERNS - alt
b-  [^m]a- #- +- -+ Ø-

It was meant to be part of a heuristic musical chord name recognition system. Although I have abandoned the idea for the time being, looking back at it is confusing. :unsure:

Edited by czardas
Link to comment
Share on other sites

Is that Google Chrome? How did you pin those tabs in the left corner?

Edit: Holy shit there's a pin tab option!>!@#!@#!@#!#$@$5t35 never saw that

Edited by Info
Link to comment
Share on other sites

It's not my browser. I just found the screenshot.

I'd like to hav the complete definition list, but the url is not accessible without an account and I don't feel like creating one.

Why are there no defines in AutoIt. I want to create such code with it, too :unsure:

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Does this count as pseudocode?

I thought it was real code, but it just made me think of something. If you could define keywords, and introduce syntax, in some way that allowed the code to be easily interpreted as natural language; then you could write something that others would perceive as being a story. Only if you compiled it, would it become a program. If someone asks what you are doing, depending on who asks, you could pretend you are writing a story. I'm still trying to think of a purpose for this crazy idea. :unsure: Edited by czardas
Link to comment
Share on other sites

That is some really bad code, reminds me of the How to Write Unmaintainable Code article.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...