Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Okay, have fun Smile Don't forget to copy down the specs so you have them where ever you are.
Good Idea, so C++ merthese program mine.
Edit: I do not get the "h" command, it seeks to the character after the next "h" character. What does that mean?
It means that this will print "merth": "hI am a long string. Ignore me!hm" because it will see the "h", and keep looking for the next "h", once it reaches it, it does what the character after it says. It might make more sense to look at other people's code to see how they did it. (Though you might feel like you are cheating <.<).

Also, FWIW, I am writing a "Merthing @ Kerm with Nikky" extension. Here is what it looks like right now:
Quote:
n - add next character to accumulator.
i - input a character -> accum
k - "nikky"
k - above.
y - loops a number of times based on the next character. (for instance, \0 would loop 0 times, and A would loop 65 times)
calcman wrote:
Well, I would have to code on paper then transfer to computer due to restricted computer time.

Coding on paper can teach you a lot about planning ahead. Go for it.
Tanner, your z80 code is all wrong.

Except it's great. Smile The only thing that bothers me is the massive number of macros.
KermMartian wrote:
Tanner, your z80 code is all wrong.
Perfect. Smile

Quote:
Except it's great. Smile The only thing that bothers me is the massive number of macros.

If you are talking about the long list of macros at the top, I just transfer that from file to file. It is mostly for syntax / to make sure I understand the syntax and can use it. I think the only macros I used were: randjr (or something like that), and that was to just get rid of the repeated code that I would have used there. I rarely use any of them in my normal code. The most used one being store(), followed by setmem(), and then perhaps getkey(). Either way, yay Very Happy Kerm approves of my code Very Happy

Edit: I got bored... Javascript:

Code:
stdout = "";
merthese_clean = function() {
    stdout = "";
}
merthese_print = function(string) {
    stdout += string;
}
merthese_display = function() {
    print(stdout);
}
merthese = function(program) {
    hflag = true;
    mprint = merthese_print;
    mclean = merthese_clean;
    mdisplay = merthese_display;
   
    mclean();
    for(i=0;i<program.length;i++) {
   cur = program.substr(i,1);
   if ( cur == 'h' )
       hflag = !hflag;
   if ( hflag )
       switch ( cur ) {
       case 'm':
      mprint("merth");
      break;
       case 'e':
      mprint("\n");
      break;
       case 'r':
      mprint(" ");
      break;
       case 't':
      for(j=0;j<Math.floor(Math.random() * 13.4);j++)
          mprint(String.fromCharCode(Math.floor(Math.random() * 27) + 'a'.charCodeAt(0)));
      break;
       }
    }
    mdisplay();
}
KermMartian wrote:
he only thing that bothers me is the massive number of macros.

Never ever look at the iPaint of Stratcon sources.
Perhaps .Inc files for macros++, tanner? Wink
Guys, we're up to 13 languages this has been implemented in.
That's awesome.
I just made one in Prizm basic, So 14. I don't have to post the code do I?
You don't have to, but it kinda defeats the purpose if you don't.
Ashbad, I don't put them in .inc files so it is easier to see what the arguments for them are.
Actually I can't post it yet, I still do not understand what the "h" does in merthese.
_player1537 wrote:
Ashbad, I don't put them in .inc files so it is easier to see what the arguments for them are.


eh, that makes perfect sense. Also, it makes the code for that whole "hey look at the top of the code there's so much writing in such a small place doesn't it look COMPLICATED I am smart aren't I" lingo in the process too Laughing always a cool thing to go for.
It's like a goto. It goes to the next 'h'. So if you have:

Code:
mhmhm

It should give you:

Code:
merthmerth

because it got the first 'm', printed "merth", got to the 'h', seeked to the next 'h' (skipping the middle 'm'), and then gets to the last 'm' and prints 'merth'.
Okay, I will implement that right now, but with one more question... what if there isn't another "h"?
Then nothing to the right of it gets printed, and the program terminates. My TI-BASIC implementation sets the value of the variable in the For( loop to the position of the next "H" in the string Str1+"H", if that makes sense. This ensures that there's an "H" to find, in case there were an odd number of them.
Ashbad, meh. It is easier on me because I can just do C-x [ and look at my macros, perhaps even add one, and then scroll bad to where I was. If it were in another include file, I'd have to load the file, check everything and then switch back to my program. I have tried keeping it in an include file because it _is_ a much better practice, but it ended up getting confusing, and the whole loading of another file got annoying too.
I'm currently writing a C++ version for this. I thought at first that it was silly to write in C++ (since there's already a C version), but then decided to go further - write a full blown Merthese console! Smile

It's still a WIP - I have to play around with modifying a wxTextCtrl class to make a terminal... Razz So here's a screenshot to drool at! Smile (Simulated)



_player1537 wrote:
Also, FWIW, I am writing a "Merthing @ Kerm with Nikky" extension. Here is what it looks like right now:
Quote:
n - add next character to accumulator.
i - input a character -> accum
k - "nikky"
k - above.
y - loops a number of times based on the next character. (for instance, \0 would loop 0 times, and A would loop 65 times)
I hope you aren't serious... Razz That's a lot more to write!
Of course I'm serious! Also, I think I may try to steal part of your idea (the interactive terminal) and write that in my C version for practice, if you don't mind, of course.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 3 of 7
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement