开发者

Suggested variable system and procedures to incorporate this LEET table into my Free Pascal program

开发者 https://www.devze.com 2023-03-05 20:19 出处:网络
I code using Free Pascal and Lazarus. I want to incorporate the LEET Table seen here (http://en.wikipedia.org/wiki/Leet#Orthography) into a new program, but I\'m unsure of the best way to do so. Sho

I code using Free Pascal and Lazarus.

I want to incorporate the LEET Table seen here (http://en.wikipedia.org/wiki/Leet#Orthography) into a new program, but I'm unsure of the best way to do so. Should I use array structures (one for each letter of the alphabet) or 'Set Types' for each letter or records for each letter? Any suggestions of how to implement an idea would be appreciated.

The aim of the program is to open and read a tex开发者_如何学编程t file line by line (I've got this done already) using an OpenDialog and it will then say "For each word, if it finds the letters 'E', 'O' or 'I', replace them with values from the table for the letter found"

e.g. if strLineFromFile contains letter 'E', replace it with 3, £, + &....and so on

repeat
  ...
  strLineFromFile(Readln(SourceFile));
  Look for letters E, I and O in strLineFromFile
    Lookup LEET Table - Switch chars
until EOF(SourceFile);

I'm open to suggestions on the best way to optimise this process - I'm not expecting pure code but pointers as to perhaps what function\procedures would be best and what variable system to use for ptimum performance.

Note : I'm still learning so nothing too complex please!

Ted


Sets are not ordered, so they don't make sense here.

An array['a'..'z'] of array of string. The first array level is all letters in the input, the second array allows for various translations of the same input-letter.

0

精彩评论

暂无评论...
验证码 换一张
取 消