New to Smilebasic need challenge suggestions (Page 2) ● SmileBASIC Source Forums

Register

# New to Smilebasic need challenge suggestions

1 2
• #21 ✎ 7 Harionago
While i have your attention. I am using TOUCH to get the position of the touch screen. I then print the position on the screen. For some reason, the Y value freaks out and displays the wrong number. Especially when I'm touching nearer the top of the screen. 7R7QN3QJ Do you know what's happening here?
It looks like the text you printed isn't getting cleared, so if Y is, say, 123, and then changes to 99, the 3 will stay on screen and it'll look like 993.
I feel like an idiot now haha thank you
Posted
• #22 ✎ 477 SquareFingers
The good habit tip was given. "Try not to rely on GOTO's." One step at a time, buddy. One step at a time.
Sorry, I was following JustGreat's lead in assuming that even a beginner can handle more than one ('the') tip. Especially, one asking to be challenged.
Posted Edited by SquareFingers
• #23 ✎ 7 towerbooks3192 Ok, all I asked for was some simple challenge suggestions like a number generator and a list. Now that escalated quickly. I will mess around with the game some more and keep those coding tips in mind for when I will get to the more advanced level. Posted
• #24 ✎ 94 seggiepants Ideas:
1. Print "Hello World"
2. Create a function that returns temperature in celsius given farenheit and another that goes from celsius to farenheit.
3. Ask the user's name and age. Tell them they are old, a baby, etc. depending on age ranges.
4. Random number guessing game. Computer picks a random number. User enters in guesses. Computer say if you need to guess higher or lower. User wins if they guess the number.
5. Hangman. User guesses letters (a through z) of a secret word (from a list of secret words). With each miss draw part of the man. Guess the word to win, run out of body parts to lose.
6. Tic Tac Toe or Naughts and Crosses. Bonus points if you can play against the computer
7. Mad Libs ask the user for a set of nouns, verbs, etc. When complete print out the resulting silly story. Bonus points if you can load questions and story template from file.
8. FizzBuzz. Create a program that prints numbers 1 to 100. However, if the number is a multiple of 3 print Fizz. If it is a multiple of 5 print Buzz, and if it is a multiple of both 3 and 5 print FizzBuzz.
9. Word Scramble. Pick a word from a list of known words and randomly mix up the letters. User enters guesses of the original words and wins on a match.
10. Slot machine/One armed bandit. Keep track of winnings and losses.
You should be able to do those with just text. Bonus points for graphics. Let me know if you want more. That was a no on the exercism thing right, or did it just get lost in the deluge?
Posted
• #25 ✎ 7 towerbooks3192
Ideas:
1. Print "Hello World"
2. Create a function that returns temperature in celsius given farenheit and another that goes from celsius to farenheit.
3. Ask the user's name and age. Tell them they are old, a baby, etc. depending on age ranges.
4. Random number guessing game. Computer picks a random number. User enters in guesses. Computer say if you need to guess higher or lower. User wins if they guess the number.
5. Hangman. User guesses letters (a through z) of a secret word (from a list of secret words). With each miss draw part of the man. Guess the word to win, run out of body parts to lose.
6. Tic Tac Toe or Naughts and Crosses. Bonus points if you can play against the computer
7. Mad Libs ask the user for a set of nouns, verbs, etc. When complete print out the resulting silly story. Bonus points if you can load questions and story template from file.
8. FizzBuzz. Create a program that prints numbers 1 to 100. However, if the number is a multiple of 3 print Fizz. If it is a multiple of 5 print Buzz, and if it is a multiple of both 3 and 5 print FizzBuzz.
9. Word Scramble. Pick a word from a list of known words and randomly mix up the letters. User enters guesses of the original words and wins on a match.
10. Slot machine/One armed bandit. Keep track of winnings and losses.
You should be able to do those with just text. Bonus points for graphics. Let me know if you want more. That was a no on the exercism thing right, or did it just get lost in the deluge?
This is a pretty solid starting goal. Thanks for this. I checked the site but kinda scared to open it since I am unfamiliar with it. I came here directly to ask for challenges since I know it will be Smilebasic specific but I will try and see that site again once i feel comfortable with this app. Keep the text challenges coming then I might move to more graphical ones.
Posted
• #26 ✎ 202 JustGreat First Month Joined in the very first month of SmileBASIC Source Website Avatar Taboo I didn't change my avatar for 180 days Website Night Person I like the quiet night and sleep late. Express Yourself
Ok, all I asked for was some simple challenge suggestions like a number generator and a list. Now that escalated quickly.
That was a no on the exercism thing right, or did it just get lost in the deluge?
I'm sorry if I accidentally derailed the discussion by discussing programming tips instead of giving examples of simple programs to learn from. I didn't really start with smaller programs, rather I've just been working on (overly) ambitious projects for the past 2 years, so I shared, roughly, the way I learned SmileBASIC over time. I really hope we didn't leave a bad taste in your mouth!
Posted
• #27 ✎ 5 ARUSS Gardening I like to garden! Hobbies Reading I like to read books! Hobbies Day Person I like the warm sunshine and wake up early! Express Yourself Those are some pretty good exercises seggiepants. The Fizz Buzz one especially brought back some memories of computer science 101 classes. Posted
• #28 ✎ 7 towerbooks3192
Ok, all I asked for was some simple challenge suggestions like a number generator and a list. Now that escalated quickly.
That was a no on the exercism thing right, or did it just get lost in the deluge?
I'm sorry if I accidentally derailed the discussion by discussing programming tips instead of giving examples of simple programs to learn from. I didn't really start with smaller programs, rather I've just been working on (overly) ambitious projects for the past 2 years, so I shared, roughly, the way I learned SmileBASIC over time. I really hope we didn't leave a bad taste in your mouth!
No need to apologise, mate. I kinda wanted something like what they thought in school's computer classes and seggie pretty much hits the nail on the head with what I was looking for. Will go through everything posted here and take note of it somewhere. Might even post my solutions when and if I managed to achieve it.
Posted
• #29 ✎ 7 towerbooks3192 Update: Print challenge done Fahrenheit to Celsius and vice versa done (got the maths and inputs working but will have a look and give it more polish after work tomorrow.) User input +age range is next on my list then I will play around with RND. Fizz Buzz sounds interesting and reminds me of a TIS-100 puzzle. Posted
• #30 ✎ 408 UnderCake Halloween 2017 Contest Runner Up I placed 2nd in the SmileBASIC Source Halloween 2017 Contest! Programming Contest Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength First Year My account is over 1 year old Website INPUT is great but (ignore if you dont understand) if you want more then make your own keyboard -though this is only for more advanced stuff that needs one lol.. you could make a simple game where you collect coins or something. or a button pressing game idk lol (oops) Posted
• #31 ✎ 1658 12Me21 Head Admin Third Year My account is over 3 years old Website Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself I'd strongly reccommend learning how to use sprites pretty early, since it's a lot easier to use sprites for moving objects than it is to use text or graphics. I think there might be a tutorial somewhere. Posted
• #32 ✎ 202 JustGreat First Month Joined in the very first month of SmileBASIC Source Website Avatar Taboo I didn't change my avatar for 180 days Website Night Person I like the quiet night and sleep late. Express Yourself A game where you use button input (BUTTON()) to move around a sprite (SPSET & SPOFS) would be a good way to learn what makes SmileBASIC so different from other game development languages; sprites and input are massively simplified (for better or for worse). Once you've mastered that, explore the other commands that are recommended in the editor when you type SP. Nearly all of them control sprites at varying levels of complexity. Try to shift the values modified by them with other buttons, such as ABXY, or the shoulder buttons. On a side note, BG layers are also important if you plan on doing anything with a fancy backdrop. Similar to sprites, which have functions prefixed with SP-, background layers have functions which are prefixed with BG-. Posted Edited by JustGreat
• #33 ✎ 7 Harionago Is there anywhere that explains SPCOL for beginners? Posted
• #34 ✎ 110 Autz64 End of 2017 Contest Participant I participated in the SmileBASIC Source End of 2017 Contest! Programming Contest Avatar Taboo I didn't change my avatar for 180 days Website Deep Sleep Hidden Website
Is there anywhere that explains SPCOL for beginners?
SPCOL serves as a hitbox for sprites. You see, sprites has Width and Height that not only serves to define the size of the sprite, but also defines the size of the hitbox. If you use SPCOL, you will activate the hitbox, and since hitboxes don't interact with non-collisionable sprites (sprites that doesn't have an active hitbox), you have to activate their hitboxes as well. ``` 'SPSET ID,U,V,Width,Height,Attribute SPSET 0,0,0,16,16,1 SPCOL 0,1 'The hitbox will have a size of 16x16, as defined on SPSET with the Width and Height values ``` When a hitbox touches another sprite that also has a hitbox, it will return the ID of the sprite that touched it (by using SPHITSP). With that you can perform certain actions, for example, damage the player if touched a projectile or a spike, or "pickup" an item. ``` SPSET 0,0 'Strawberry SPSET 1,1 'Orange SPCOL 0,1 'Activate collision for Sprite 0 SPCOL 1,1 'Activate collision for Sprite 1 'If Sprite 0 touches Sprite 1, Sprite 1 will disappear IF SPHITSP(0)==1 THEN SPCLR 1 ``` However, hitboxes on SmileBASIC are, well, Basic. Something you have to realize is that certain special effects like SPROT or SPHOME won't affect the hitbox at all (with the exception of SPSCALE). Keep this in mind if you want to archieve accurate collision detection with scaled/rotated sprites. But well, SPCOL on most cases is what you need for this kind of stuff.
Posted
• #35 ✎ 7 Harionago
Is there anywhere that explains SPCOL for beginners?
SPCOL serves as a hitbox for sprites. You see, sprites has Width and Height that not only serves to define the size of the sprite, but also defines the size of the hitbox. If you use SPCOL, you will activate the hitbox, and since hitboxes don't interact with non-collisionable sprites (sprites that doesn't have an active hitbox), you have to activate their hitboxes as well. ``` 'SPSET ID,U,V,Width,Height,Attribute SPSET 0,0,0,16,16,1 SPCOL 0,1 'The hitbox will have a size of 16x16, as defined on SPSET with the Width and Height values ``` When a hitbox touches another sprite that also has a hitbox, it will return the ID of the sprite that touched it (by using SPHITSP). With that you can perform certain actions, for example, damage the player if touched a projectile or a spike, or "pickup" an item. ``` SPSET 0,0 'Strawberry SPSET 1,1 'Orange SPCOL 0,1 'Activate collision for Sprite 0 SPCOL 1,1 'Activate collision for Sprite 1 'If Sprite 0 touches Sprite 1, Sprite 1 will disappear IF SPHITSP(0)==1 THEN SPCLR 1 ``` However, hitboxes on SmileBASIC are, well, Basic. Something you have to realize is that certain special effects like SPROT or SPHOME won't affect the hitbox at all (with the exception of SPSCALE). Keep this in mind if you want to archieve accurate collision detection with scaled/rotated sprites. But well, SPCOL on most cases is what you need for this kind of stuff.
Perfect thank you so much!
Posted
• #36 ✎ 94 seggiepants I created the exercism.io app with coding exercises for SmileBasic that I was talking about earlier in the thread. 5RDXV3CJ if you want to check it out. http://smilebasicsource.com/page?pid=886 Posted Edited by seggiepants
• #37 ✎ 557 random_god Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Video Games I like to play video games! Hobbies i finally looked at this, you have a variable and the `inc` command increases the value. if you put `print variable`, have a loop, and an `if variable==value then dec` it will work. Posted
1 2