As a long time lurker, first time poster, I have decided to make a "programming language" today (It is really just a little passion project).
It has very simple syntax and is made in Fortran.
P=Print the letter that is associated with the current charnum value and end the program.
A=Add to the current charnum value.
M=Subtract (or minus) from the current charnum value.
S=Prints the syntax that can be used.
Code:
I am open to all suggestions!!
It has very simple syntax and is made in Fortran.
P=Print the letter that is associated with the current charnum value and end the program.
A=Add to the current charnum value.
M=Subtract (or minus) from the current charnum value.
S=Prints the syntax that can be used.
Code:
program pams_interpreter_v1
implicit none
character(len=1) :: pams
integer :: charnum
charnum=0
do
write(*,'(a)')
read (*,'(a)') pams
if (pams=='p') then
print *, charnum
exit
endif
if (pams=='a') then
charnum=charnum+1
endif
if (pams=='m') then
charnum=charnum-1
endif
if (pams=='s') then
print *,'This is an intperpreter for PAMS, a simple programming language'
print *,'created by your very own, Large_fard.'
print *,'P is to print the name,'
print *,'A is to add to the stack,'
print *,'M is to subtract (or minus) from the stack and '
print *,'S is to print this.'
exit
endif
enddo
if (charnum==1) then
print *,'a'
endif
if (charnum==2) then
print *,'b'
endif
if (charnum==3) then
print *,'c'
endif
if (charnum==4) then
print *,'d'
endif
if (charnum==5) then
print *,'e'
endif
if (charnum==6) then
print *,'f'
endif
if (charnum==7) then
print *,'g'
endif
if (charnum==8) then
print *,'h'
endif
if (charnum==9) then
print *,'i'
endif
if (charnum==10) then
print *,'j'
endif
if (charnum==11) then
print *,'k'
endif
if (charnum==12) then
print *,'l'
endif
if (charnum==13) then
print *,'m'
endif
if (charnum==14) then
print *,'n'
endif
if (charnum==15) then
print *,'o'
endif
if (charnum==16) then
print *,'p'
endif
if (charnum==17) then
print *,'q'
endif
if (charnum==18) then
print *,'r'
endif
if (charnum==19) then
print *,'s'
endif
if (charnum==20) then
print *,'t'
endif
if (charnum==21) then
print *,'u'
endif
if (charnum==22) then
print *,'v'
endif
if (charnum==23) then
print *,'w'
endif
if (charnum==24) then
print *,'x'
endif
if (charnum==25) then
print *,'y'
endif
if (charnum==26) then
print *,'z'
endif
end program pams_interpreter_v1
I am open to all suggestions!!