Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Semrush - keyword research tool

Turn ChatGPT, Claude, Gemini, And CoPilot Into Your Personal Assistant, Business Coach, Content Creator, And More

AFFILIATE MARKETING Your all-in-one performance engine Manage affiliates, creators, and customer referrals in one unified platform—turning every partnership into measurable growth
Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

42,844 questions

55,671 answers

573 users

How to convert "7H15 M3554G3" into words in Pascal

1 Answer

0 votes
// 7H15 M3554G3 is written in leet speak, where numbers resemble letters. 
// place each leetspeak character with its matching letter 
// (7 -> T, 1 -> I, 5 -> S, 3 -> E) and build a new string
// 7H15 -> THIS | M3554G3 -> MESSAGE
 
// Your brain can interpret distorted or number‑substituted letters 
// surprisingly well because it recognizes the overall word 
// shapes and patterns, not just individual characters.

program LeetToText;

{$mode objfpc}

function ConvertChar(c: Char): Char;
begin
  case c of
    '7': Result := 'T';
    '1': Result := 'I';
    '5': Result := 'S';
    '3': Result := 'E';
    '4': Result := 'A';
    '0': Result := 'O';
  else
    Result := c;  // keep letters like H, M, G
  end;
end;

function LeetToText(const s: String): String;
var
  i: Integer;
begin
  SetLength(Result, Length(s));
  for i := 1 to Length(s) do
    Result[i] := ConvertChar(s[i]);
end;

var
  input: String;

begin
  input := '7H15 M3554G3';

  WriteLn(LeetToText(input));
end.



(*
run:

THIS MESSAGE

*)

 



answered Apr 27 by avibootz
edited Apr 27 by avibootz
...