what's the range of the difficulty level and which value would be difficult and which would be easy?
Ehm ... you should have some lessons in data-structures and procedural programming. Besides cleaner code this would also save you a lot of HUB-RAM. Let's see what we can do for you in this thread ;o)
Lesson one:
Functions and loops are your friend!
In the beginning of your code you do the same thing several times.
1. Clear the screen
2. Print two lines of text
3. Wait for 3 sec.
4. goto 1
This pretty much looks like a function and a loop could be helpful here. Parameter of the function would be the address of the strings to write. For that you have to move the strings into a dat-section and loop through the strings.
stringptr := @mystrings ' where mystrings is the label for the dat section that contains all strings in a row
repeat 5
printMessage( stringptr, stringptr+=strsize(stringptr) )
stringptr+=strsize(stringptr)
printMessage would then clear the screen, output string 1 in line 1 and string 2 in line 2 and wait for 3 sec.
This would be a special-case improvement. If you want printMessage to be general-purpose you'd for example only print one string but add the screen-position and call it twice and do the wait in the loop. Both would result in a smaller RAM usage - try it.
Are you out to prove that you are a better "SPIN" programmer than me? I am just offering an example for beginners to programming and the Propeller, although you may offer valid suggestions, I feel insulted. Thats okay, if I am so inept, I will remove the post.
No reason to feel insulted! That was not my intention. And no ... I'm not out to prove something. I was just offering some lessons on how to improve what you did. A lot of beginners will do their first steps in the same way and improving the code you wrote will also help them.
As I am not a native english speaker and most times try to write useful posts - for example containing functioning code snippets and hopefully containing as little errors as possible - it often takes 10 minutes or even much more to write a post. If you think I waste my time by answering to this thread, please let me know. I have other good ideas and can spend my time with these instead.
I feel insulted!
Ehm ... you should have some lessons in data-structures and procedural programming. Besides cleaner code this would also save you a lot of HUB-RAM. Let's see what we can do for you in this thread ;o)
If that is not a very serious insult, I do not know what is.
The problem with language is that sometimes people communicating with each other have a different understanding/feeling when reading/writing the same sentence. Also sometimes the problem of missunderstanding only arises because of the moods reader and writer are in at the time they read/write. And the language barrier does not make thing easier.
What I learned in this forum is that nobody wants to insult or humiliate somebody else here. There are forums out there that are much worse in this matter.
If that is not a very serious insult, I do not know what is.
You should have some lessons in proper etiquette.
Bruce
That is not a very serious insult. I wouldn't consider it as the merest hint of an insult having crossed the mind of the author. As a language, German has some fairly rigid formal grammatical structures and MagIO2 has ported them across to his English, as he acknowledges in his other post. The "Ehm.." and ";o)" allude to informality.
Alas, IMHO, your responses and your impetuous deletion of all your attachments have made yourself look rather immature and a bit of a chump, old bean...
Hopefully this thread will be locked soon. Crikey. Talk about perpetuating national sterrotypes Bruce.
@Hugh:
Thank you for your opinion. I really considered that I did something wrong!
And yes, Bruce does not cool down and maybe it's better to lock this thread.
@Bruce:
You can have data structures in any programming language. You seem to mix up data structures with data types.
I've been programming for 30 years and I'm still open for learning from other coders. But I also like to share knowledge, experience and ideas. That's why I'm here. Your code example made me feel that I should share some of this here.
Just for completeness, here is my list:
BASIC
Assembler of 6502, I486, 8052, PIC, AVR, R8, Propeller
Pascal
C
C++
Perl
PHP
HTML
XSLT
Java
JavaScript
DCL
SQL
PL/SQL
Forth
Lisp
SPIN
OK, can I say something from an outsider and a beginner (all over again). First off I would like to apologize to anyone that could be offended by what I say in this post.
When I first seen the subject line about 2 hours ago, I thought “Cool more ideas and maybe a better understanding of SPIN” (having the hardest time). But to my dismay everything was removed. Why? Because someone thought they were being insulted? COME ON NOW! If I had a penny every time that happened to me I would be the richest man on the earth.
Now this listing has turned from giving others ideas or another way of looking at things into a peeing contest. Please let’s start over, repost the information and see what happens.
If they are emailed to me then I have only one idea on how it works. I am not saying “this person’s idea is better than that person”. I am saying we should have other ideas from different sources.
I could not agree more. It was not so much what he said, but how he said it. It could have been very constructive, if he had simply said "Bruce here are a few recommendations to reduce loop count and the HUB-RAM required". It could have then turned into a better example then the one I provided. You and I could have both learned from it.
However, I will not continue to provide source code if I feel that people with more "SPIN" programming experience than me are insulting me.
This is a family based forum; no one here is trying to insult you. And I am sorry you feel that way. And because you feel you were insulted you are punishing other people by not having your ideas on here so others can admire it.
You want to talk about insulting?
About 2 years ago I was in a horrific motorcycle accident. Going 65MPH on the freeway, car changes lanes clips my back tire. I go over the handle bars and hit the ground with my face (leaving out gory details). After 6 months in a coma, I wake up to find out I no longer look like I used to and I am missing some facial features. (Again leaving out gory details). I can’t walk in the mall or anywhere else without some teenage kid pointing and laughing. THAT is insulting! Because now not just the kid is staring, but so is everyone else. But you know what "I don't care"!
Comments
what's the range of the difficulty level and which value would be difficult and which would be easy?
Ehm ... you should have some lessons in data-structures and procedural programming. Besides cleaner code this would also save you a lot of HUB-RAM. Let's see what we can do for you in this thread ;o)
Lesson one:
Functions and loops are your friend!
In the beginning of your code you do the same thing several times.
1. Clear the screen
2. Print two lines of text
3. Wait for 3 sec.
4. goto 1
This pretty much looks like a function and a loop could be helpful here. Parameter of the function would be the address of the strings to write. For that you have to move the strings into a dat-section and loop through the strings.
printMessage would then clear the screen, output string 1 in line 1 and string 2 in line 2 and wait for 3 sec.
This would be a special-case improvement. If you want printMessage to be general-purpose you'd for example only print one string but add the screen-position and call it twice and do the wait in the loop. Both would result in a smaller RAM usage - try it.
More to come .... ;o)
Are you out to prove that you are a better "SPIN" programmer than me? I am just offering an example for beginners to programming and the Propeller, although you may offer valid suggestions, I feel insulted. Thats okay, if I am so inept, I will remove the post.
Bruce
As I am not a native english speaker and most times try to write useful posts - for example containing functioning code snippets and hopefully containing as little errors as possible - it often takes 10 minutes or even much more to write a post. If you think I waste my time by answering to this thread, please let me know. I have other good ideas and can spend my time with these instead.
I feel insulted!
Supposedly every attachment that I ever made to Parallax has now been deleted.
Bruce
Please refer to the top post.
Bruce
If that is not a very serious insult, I do not know what is.
You should have some lessons in proper etiquette.
Bruce
What I learned in this forum is that nobody wants to insult or humiliate somebody else here. There are forums out there that are much worse in this matter.
Alas, IMHO, your responses and your impetuous deletion of all your attachments have made yourself look rather immature and a bit of a chump, old bean...
Hopefully this thread will be locked soon. Crikey. Talk about perpetuating national sterrotypes Bruce.
I have been programming over 10 years. I can program fairly well in the following languages:
- C++
- HTML
- Perl
- And now I am learning Spin
For MagIO2 to post in my thread that:Believe me that is an insult.
Bruce
You want data structures, try a few C++ data structures.
Thank you for your opinion. I really considered that I did something wrong!
And yes, Bruce does not cool down and maybe it's better to lock this thread.
@Bruce:
You can have data structures in any programming language. You seem to mix up data structures with data types.
I've been programming for 30 years and I'm still open for learning from other coders. But I also like to share knowledge, experience and ideas. That's why I'm here. Your code example made me feel that I should share some of this here.
Just for completeness, here is my list:
BASIC
Assembler of 6502, I486, 8052, PIC, AVR, R8, Propeller
Pascal
C
C++
Perl
PHP
HTML
XSLT
Java
JavaScript
DCL
SQL
PL/SQL
Forth
Lisp
SPIN
C++?
Give me the data structure for an icon
When I first seen the subject line about 2 hours ago, I thought “Cool more ideas and maybe a better understanding of SPIN” (having the hardest time). But to my dismay everything was removed. Why? Because someone thought they were being insulted? COME ON NOW! If I had a penny every time that happened to me I would be the richest man on the earth.
Now this listing has turned from giving others ideas or another way of looking at things into a peeing contest. Please let’s start over, repost the information and see what happens.
I will be more than happy to email you the files.
Bruce
I could not agree more. It was not so much what he said, but how he said it. It could have been very constructive, if he had simply said "Bruce here are a few recommendations to reduce loop count and the HUB-RAM required". It could have then turned into a better example then the one I provided. You and I could have both learned from it.
However, I will not continue to provide source code if I feel that people with more "SPIN" programming experience than me are insulting me.
Bruce
You want to talk about insulting?
About 2 years ago I was in a horrific motorcycle accident. Going 65MPH on the freeway, car changes lanes clips my back tire. I go over the handle bars and hit the ground with my face (leaving out gory details). After 6 months in a coma, I wake up to find out I no longer look like I used to and I am missing some facial features. (Again leaving out gory details). I can’t walk in the mall or anywhere else without some teenage kid pointing and laughing. THAT is insulting! Because now not just the kid is staring, but so is everyone else. But you know what "I don't care"!
Yes, I can imagine that being insulting, but that does not change the fact that I take pride in my work and my programming.
Bruce