Speak n Spell (Texas Instrument) -> Secret code algo

Share your advanced PureBasic knowledge/code with the community.
Olli
Addict
Addict
Posts: 1272
Joined: Wed May 27, 2020 12:26 pm

Speak n Spell (Texas Instrument) -> Secret code algo

Post by Olli »

:mrgreen:

Code: Select all

Procedure.S SecretCodeKey(a$)
 Define s$
 For i = 1 To Len(a$)
  s$ + Chr(((96 - (Asc(Mid(a$, i, 1) ) & $DF) ) % 26) + 65)
 Next
 ProcedureReturn s$
EndProcedure
Infos / Demo

QYRSB YRTB
Jeromyal
Enthusiast
Enthusiast
Posts: 216
Joined: Wed Jul 17, 2013 8:49 am

Re: Speak n Spell (Texas Instrument) -> Secret code algo

Post by Jeromyal »

BM
User avatar
NicTheQuick
Addict
Addict
Posts: 1537
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Speak n Spell (Texas Instrument) -> Secret code algo

Post by NicTheQuick »

The "Demo"-Link points to a private video.

I also don't get the trick or tip here. :?:
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
Olli
Addict
Addict
Posts: 1272
Joined: Wed May 27, 2020 12:26 pm

Re: Speak n Spell (Texas Instrument) -> Secret code algo

Post by Olli »

NicTheQuick wrote: Thu Jul 21, 2022 9:57 am The "Demo"-Link points to a private video.

I also don't get the trick or tip here. :?:
The "Demo"-Link has been switched privated, between yesterday and today. Maybe surprised by anything... Anyway, no problem with I published, and with this author published on youTube. Maybe, it will switch back !

If you do not get the trick or tip, maybe the context missed. I was 4 when I got this strange device on my hand, and I used very few because of the use of the batteries. I just remember these different strange characters I read when I touch (flat keyboard version) the key "secret code". So, now I remember several character changes, I chose pureBasic to publish this algo, hoping, in the forum, anybody who got this device, for 35 years, understands why such this algo ! (it is a basic one) but certainly anybody has some old papers with these changed letters, but not the device, nor the algo, such simple this being !
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: Speak n Spell (Texas Instrument) -> Secret code algo

Post by Mijikai »

Solution :)

Code: Select all

Procedure.s SecretDecode(Input.s)
  Protected *chr.Ascii
  Protected code.s
  *chr = @Input
  Repeat
    If *chr\a < 81
      code + Chr(102 + (65 - *chr\a))
    Else
      code + Chr(90 - *chr\a + 103)
    EndIf
    *chr + 2
  Until *chr\a = #Null
  ProcedureReturn code
EndProcedure
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5526
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Speak n Spell (Texas Instrument) -> Secret code algo

Post by Kwai chang caine »

I don't know if i have good understand the subject :oops:
But here...apparently that not works :|

Code: Select all

Procedure.S SecretCodeKey(a$) ; Olli
 Define s$
 For i = 1 To Len(a$)
  s$ + Chr(((96 - (Asc(Mid(a$, i, 1) ) & $DF) ) % 26) + 65)
 Next
 ProcedureReturn s$
EndProcedure

Procedure.s SecretDecode(Input.s) ; Mijikaï
  Protected *chr.Ascii
  Protected code.s
  *chr = @Input
  Repeat
    If *chr\a < 81
      code + Chr(102 + (65 - *chr\a))
    Else
      code + Chr(90 - *chr\a + 103)
    EndIf
    *chr + 2
  Until *chr\a = #Null
  ProcedureReturn code
EndProcedure

a$ = "Coucou les petits loups, j'ai bien mangé"

a$ = SecretCodeKey(a$)
Debug a$
Debug SecretDecode(a$)
ImageThe happiness is a road...
Not a destination
Post Reply