![]() |
Small Basic AI Championship - Printable Version +- Small Basic Forum (https://litdev.uk/mybb) +-- Forum: Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=1) +--- Forum: Discussion (https://litdev.uk/mybb/forumdisplay.php?fid=4) +--- Thread: Small Basic AI Championship (/showthread.php?tid=9) |
RE: Small Basic AI Championship - AbsoluteBeginner - 04-19-2024 (translated by Google translator) Hi all. For more than a week I wrote the code for the prototype of the "Nature" program. Here is the program number: PJBJ480.000 I only had 40...80 minutes a day. But this has become real entertainment from the moment Aliases appeared in SB-Prime. ![]() During the creation of this prototype, I was getting used to the updated SB-Prime and the LD library. Surprisingly, using SB-Prime, I like to create code even for things that no one will need. For many years of my life I could not do this. This brought back the joy of creativity to me, because programming gives you the opportunity to create different things without spending money on materials. In the current version of my prototype, I'm modeling a way to inform the user about the state of the Server's Connection with two Clients. The Connection and Disconnection events of clients are simulated using two CheckBox controls. Switching the Server on and off is done using its switch. I will be grateful for any tips and comments on the algorithm, design and code format. And now I want to learn how to create "tooltips". Thanks for attention. RE: Small Basic AI Championship - litdev - 04-19-2024 AB, Good work so far - it works and looks good. The structure is good with subroutines, meaningful variable names, comments, event loop. Only suggestion is to maybe not do so much work with ShapeEvents where a simple button or other LDControl would work. Also may not need so much pause and resume updates unless there is a bad flicker. So its pretty good, but maybe a little over complicated. RE: Small Basic AI Championship - AbsoluteBeginner - 04-19-2024 LitDev, I'll take your tips and test it out. Thank you. I am sure that I will not be the only person on the planet who will enjoy using SB-Prime. ![]() Aliases provide incredible freedom for a person to communicate with a computer. RE: Small Basic AI Championship - AbsoluteBeginner - 04-20-2024 (translated by Google translator) Already at night, when I was already falling asleep, I asked myself which way was better to use in the "Nature" program: 1. infinite loop "While"; 2. or only a reaction to an events ? ![]() If I only use reactions to events, then in Small BASIC is it better to call one Timer tick or execute the entire reaction code in the event handler subroutine? ( but it is known that the handler subroutine must have a minimum code size ) RE: Small Basic AI Championship - litdev - 04-20-2024 AB, I always advocate the game loop, but experimentation is fun so try different things. Reasons: 1] For complex event driven fast moving games, all the action takes place in one ordered loop - much easier to debug 2] Events can occur at any time and may also be running at the same time using the same variables - chaos 3] The main UI thread may not be updated while running in an event thread 4] If events keep coming faster than they take to complete they can stack up Compare these 2 programs Code: ball = Shapes.AddEllipse(20,20) Code: ball = Shapes.AddEllipse(20,20) When there are multiple events, potentially firing at the same time using the same variables it can get complicated, so I think the game loop makes things simpler, even though for a very small program it looks like added complexity. There are cases where it doesn't really matter - like button presses. Main thing is try it out whatever way you like and be prepared to change - I tend to write little prototypes to test ideas out. RE: Small Basic AI Championship - AbsoluteBeginner - 04-20-2024 (translated by Google translator) LitDev, thank you so much. This information is very helpful to me. So, with this information and the help you gave me in your previous message, I begin the next step towards creating the "Nature" program. ![]() RE: Small Basic AI Championship - AbsoluteBeginner - 04-21-2024 (translated by Google translator) Hi all. Please tell me how to create a tooltip using Small Basic and the libraries that are available in SB-Prime? So far I've only come up with the idea of using a shape with text. ![]() Thank you. RE: Small Basic AI Championship - litdev - 04-22-2024 AB, Search with Tools->Search Extensions in SB-Prime. We have one in IO and LD - should also work with Russian LitDev.Ru.xml translataion since it is the method name not the description. RE: Small Basic AI Championship - AbsoluteBeginner - 04-22-2024 (translated by Google translator) Wow! Cool ! I didn't know about this Search. ![]() When I manually searched in the LD library, I didn’t think to search in Dialogs. Thanks a lot. RE: Small Basic AI Championship - z-s - 04-23-2024 Hii AB I Added Some ToolTips You Can View Its In LDDialog.ToolTip Program ID : PJBJ480.000-0 ![]() Guess like working on project from sometime. |