QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: TempodiBasic on July 26, 2017, 04:54:16 am

Title: Hi everybody
Post by: TempodiBasic on July 26, 2017, 04:54:16 am
Hi everybody

fine to see that it is possible to talk and to share about QB64 out of the original website,
waiting the [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there] coming back I'm glad to say hello to all you

Good Coding
TempodiBasic
Title: Re: Hi everybody
Post by: Petr on July 26, 2017, 09:54:42 am
Hi TempodiBasic, I am glad to see you again after a long time!
Title: Re: Hi everybody
Post by: Ashish on July 27, 2017, 06:10:38 am
Hi! Welcome Back!
Title: Re: Hi everybody
Post by: bplus on July 27, 2017, 08:00:17 am
Hi TempodiBasic,

May I ask how you started with Basic?
Title: Re: Hi everybody
Post by: bplus on October 21, 2017, 12:23:39 pm
Oh, now maybe I get my question answered. :)

@ TempodBasic, what was reason you didn't like Fellippes fix to mouse click method to get player's move?

I mean it still works better than anything we've come up with. See how each square is cleared when doing mouse overs after first click.
Title: Re: Hi everybody
Post by: FellippeHeitor on October 21, 2017, 12:39:35 pm
:D
Title: Re: Hi everybody
Post by: bplus on October 21, 2017, 02:24:16 pm
Well I will try again to post 2_2-2 for comparison

Blah!  " message exceeds the maximum allowed length 20000 characters "
Title: Re: Hi everybody
Post by: bplus on October 21, 2017, 02:47:59 pm
OK try here Post #9
http://www.thejoyfulprogrammer.com/qb64/forum/showthread.php?tid=991&rndtime=15086115392028651222
Title: Re: Hi everybody
Post by: TempodiBasic on October 21, 2017, 03:12:55 pm
Hi TempodiBasic,

May I ask how you started with Basic?


Hi Bplus

as you see I have so much time, so I can log in so many forum.... If you can believe this....
However  I discover BASIC in DOS with Qbasic....
I went on when talking with friends that were learning programming as their path of school formation I took a challange....
they affirmed that BASIC was KO an unuseful old tool, taking these ideas by their school information and programming is very hard...while I said that tool is less important of idea and if each LanguageProgramming is a tool that brings to binary file then each LP can be used to translate that idea in binaryfile with the difference of less or more efforts...
And after two week I brought them my first program, a Qbasic program....and  they said Oh this is not BASIC, Where are the number  of lines of code?  What libraries do you use to make graphic?  External?  But this seems a dialect of C!   LOL

So I have told about me :-)
Title: Re: Hi everybody
Post by: TempodiBasic on October 21, 2017, 03:35:18 pm
Oh, now maybe I get my question answered. :)


Yes you're right!

Quote
@ TempodBasic, what was reason you didn't like Fellippes fix to mouse click method to get player's move?

I mean it still works better than anything we've come up with. See how each square is cleared when doing mouse overs after first click.

No really do I let understand this from my posts?
I must follow a communication course ! :-(

About choose a piece and move it  I am still in alpha phase ... that of brainstorming.... so  I'm trying different way to implement mouse moving a piece....
about the two click method I have already affirmed that the code of Fellippe is better!  So in the following versions (all in alpha for me) I bring again my code only to find /fix error in it....while the news are build as an indipendent code to add to each previouse versions posted,  but for final version I have already said what is the best code to use! Sure not mine.
I don't think to be better than you to code, but when I mod some your code I do it for developing an idea about all we can talk to choose  an official version that can be developed and if it is so good it can be packed in the programs that travel together QB64 as examples...

I dislike very much codes that are in the package of QB64 not working...  is all that code  there to demonstrate how QB64 can run QB code or to demonstrate how professional programs can be coded in QB64?

Title: Re: Hi everybody
Post by: bplus on October 21, 2017, 04:49:03 pm
Hi TempodiBasic,

Re Basic experience:
Ha, people still think Basic is line numbers and spaghetti code! bad rep... how long ago was this?

Me, I started with GW Basic. When I turned off my "Windows like Interface" on my 1st computer and ran straight from DOS with the help of a File Explorer like program, I discovered GW. Moved onto Quick Basic 4.5 (I think, I had to pay for it before MS added it to DOS for free but I got a compiler plus...) Then VB 2.0 then VB for MS DOS which was my favorite because Windows still quite slow with graphics back in early 90's, I was doing stuff for where I worked for a couple of years. Then big gap until 2014 when I got a hankering for some programming again.


Re: Mouse click methods
OK we are agreed to use Fellippe's method for mouse move? but it was great learning experience trying other methods.

And we can start adapting new changes around this,

but wait...
Oh, now I see what you might be after.

We need to go outside the board to select pieces for things like pawn promotion and maybe setting up positions for mid game study and such... aha! That is where/when that separate sub you were setting up would come into play! and yes, use it with the main thing for getting moves of chess pieces in game.


Re:All those broken samples in QB64 package...
Doesn't it make you want to use (and learn) QB64 to fix those up? better than ever!



Title: Re: Hi everybody
Post by: TempodiBasic on October 22, 2017, 05:59:52 pm
Yes Bplus
let's go on to make a professional program of chess starting from chess.bas

here attached the version of Fellippe (two click method with two different color to select pieces) powered with
1.castle by mouse,
2.promote by mouse, 
3. empowered rules of castle Kingside and Queenside,
4. fixed bug of Incheck for Black, or I hope so
5. fixed output lag after promotion in Fellippe's version.... here if you promote (as white) then you cannot see the promoted piece both using Keyinput both using mouse input because the program doesn't display the new... but a good _AUTODISPLAY at the right place put all  at right place.

For now that's all, folks

PS why does the author use so many GOTO and GOSUB and labels ???
It is a really spaghetti code rich of GOTO!!!
.....this AI doesn't recognize if King is under check in the actual position, it waits for White move first (BUG), if you take King of Black the AI continue to make calculation.... LOL We have many things to do
Title: Re: Hi everybody
Post by: bplus on October 22, 2017, 07:44:01 pm
Hi TempodiBasic,

I have been researching origins of this code we are trying to improve, mostly from Chess Programs Board at TJP.
http://www.thejoyfulprogrammer.com/qb64/forum/forumdisplay.php?fid=374&rndtime=1508611534653852581

reply #48
http://www.thejoyfulprogrammer.com/qb64/forum/showthread.php?tid=63&page=5&rndtime=1508650499163919983

follow the link
http://www.petesqbsite.com/sections/express/issue23/Tut_QB_Chess.txt

My guess someone had it written in spaghetti and translated it to QBasic. Was Dean the translator and / or the original source ???

I also think because of the temporary nature (I hope the Net is down temporarily) we should continue discussion with screen shots and attachments at TJP.

BTW, (Since NET is down) I found OlDosLover changes at
http://www.teutoburgo.tk/misc/downloadFrame.html
that has code to replay a game. From my first experience it seems flawed. But nice tiny little chess piece graphics!
But OlDosLover's game recorder looks easy to install into what we've been doing.

Speaking of Chess piece graphics, I was very impressed here:
http://www.thejoyfulprogrammer.com/qb64/forum/showthread.php?tid=401&rndtime=1508625987687357559
Code: QB64: [Select]
  1. 'DEFINE PIECES FOR DRAWING
  2. ROOK$ = "R26U5H2L5U7E3R4U10L6D3L4U3L6D3L4U3L6D10R4F3D7L5G2D5"
  3. KNIGHT$ = "R26U5H2U4E2U9H6L9G10D4F2R4E3R4G8L4G2D5"
  4. BISHOP$ = "R26U5H2L8E6U9H2G8H2E8H2L6G6D9F6L8G2D5"
  5. QUEEN$ = "R26U5H2L6E9U11G4H6G4H4G6H4D11F9L6G2D5"
  6. KING$ = "R26U5H2L5E7U6H4L5G3U5R2U2L2U2L2D2L2D2R2D5H3L5G4D6F7L5G2D5"
  7. PAWN$ = "R26U5H2L6U7E3U6H3L10G3D6F3D7L6G2D5"
Just plain old DRAW strings!!! And yet each piece is easy to ID for what it is.

I have also found a different Chess program in SmallBASIC samples files that works with mouse but draw strings need work.
It might be fun to translate back to QB64. I have never seen a sub written inside a Function nor SmallBASIC's use of square brackets, maybe for User Type Arrays without need for complementary User Type Definitions.

Do the 16 QB colors work in Screen 0?

Title: Re: Hi everybody
Post by: FellippeHeitor on October 22, 2017, 07:51:32 pm
You can do screenshots here if you want. Just attach them (as you can see below - click to see it larger).
Title: Re: Hi everybody
Post by: bplus on October 22, 2017, 08:00:46 pm
Hi Fellippe,

There seems to be a limit to attachments that I ran into earlier today. Let's see if a png OK.

Yep! tried less than 800 x 600 png, Same error:

"The upload folder is full. Please try a smaller file and/or contact an administrator.
Title: Re: Hi everybody
Post by: FellippeHeitor on October 22, 2017, 08:06:09 pm
Would you mind trying once again?
Title: Re: Hi everybody
Post by: bplus on October 22, 2017, 08:20:41 pm
Hi Fellippe,

Did you fix something?

OK cool!

Screen shot is of chess pieces from DRAW strings.

2nd Attachment is what I tried to attach earlier to compare Fellippe's fixed 2 click mouse move with 2 versions of 1 click.
One is without highlighting until mouse up release, the other was an attempt to highlight mouse over squares until the mouse button released (leaving squares all over the board depending on how much you dragged the mouse around) of course these cleared after release of mouse button, but still... not great looking/working.
Title: Re: Hi everybody
Post by: FellippeHeitor on October 22, 2017, 08:40:51 pm
I sent odin a private message and he fixed something in there.
Title: Re: Hi everybody
Post by: bplus on October 22, 2017, 09:12:53 pm
My hat's off to Odin, That was quick! :)

(and to Fellippe too!)
Title: Re: Hi everybody
Post by: bplus on October 22, 2017, 10:54:17 pm
Ha! TempodiBasic has done a chess joke!

I have put on some music, all set to sit down and try out TempodiBasic's latest version...  play some chess, and I am faced with this!

Well I guess this is going to be a quick game!
Title: Re: Hi everybody
Post by: Pete on October 23, 2017, 04:12:20 pm
I find Odin to be no help at all, but then again he's pretty Thor at me.

BRING BACK THE SIMILES!

Well about chess. Here's a blast from the past, year 2005. http://www.network54.com/Forum/190883/message/1135829684/Bug+fixed%2C+corrected+code...

I believe qbguy, Dean, started his wok in 2008. There are some builds from his chess game in that forum, too. Including the one he ported to QB64. I tried once to convert a ship building program of mine to QB64 once, but it was hard to port... Oh well, I'm sure most of you wouldn't appreciate my ship, anyhow.

Pete :D
Title: Re: Hi everybody
Post by: TempodiBasic on October 24, 2017, 06:00:51 am
Hi Pete
thank's to share this other way to create an interface of chess game

It is well suited for run under qb64 and it let play chess two users , one for side :-)

Well If white is in check and tries to castle, it is forbidden, also in the issue White while castling across a square in which it goes in check.

But I find a BUG for Black, in this position that I post as image, Black King in at first its move and so the Rook in A8, moreover there is no check acrossing D8 and C8 but the program doen't let do the move giving back move forbidden!  No castle on Queenside. And also If I try to castle on Kingside it is forbidden!!!
Blush
Your program may be racist if uses different rules for whites and blacks! Big Grin


Be calm Pete, this program is democratic because also trying to castle on Queenside for White (in this position it is possible) is forbidden!

There is a bad use of some flag! It maybe.

Hey but promotion is automated to Queen! Huh It is right only 99% of times, do you agree?

In sum
Thank's again
to show another way to code chessoboard and moving piece by two click by mouse. The rules of pieces is well coded and IMHO  must be improved about castle, promotion.
Title: Re: Hi everybody
Post by: TempodiBasic on October 24, 2017, 06:13:12 am
Hi Bplus

this is the second joke
the first came with Initboard to  use for promotion testing... it is include in the  2.3.3 alpha version with my bad clicking not so  bad.
If you pay attention there is a pawn in F7 and the turn is to white! LOL

I think we must try also the C way, highlight the destination squares  that are legal of the selected piece.
If I can find a piece of time I'll post this C way, because the idea is already set, but it must be translated in Good Code!!!

See later QB64 ChessCoders
Title: Re: Hi everybody
Post by: bplus on October 24, 2017, 06:44:39 am
Hi Chess coders!

I have new look for mouse input game. Now no outside files are needed!

Anyone know where the tiny black dots are coming from?


Hi TempodiBasic,

I think it would simplify things with Chess promotion to just make the Pawn a Queen.
Title: Re: Hi everybody
Post by: TempodiBasic on October 24, 2017, 09:24:26 am
Hi Bplus
if you and other friends have decided to use a different interface I think this is indipendent from the rest of the chess.bas, so every news that I make, you can try and add also at this new model of graphic interface, the AI behind is the same of CHESS.BAS of package of QB64.
Surely the promotion method must be adapted to new graphic style!

Well while I can take time to see this new evolution of graphic interface and new indipendence from external files here I post image about next enhancement. showing legal moves of piece selected.  This feature can be used both in regular routine to select and move a piece both in a special option activated for TUTOR.
Here is file.bas attached.
Please play some games with this news to debug Show Legal Moves.

Thank's to work together
Title: Re: Hi everybody
Post by: bplus on October 24, 2017, 01:23:59 pm
TempodiBasic
Quote
Surely the promotion method must be adapted to new graphic style!

;-))  I knew you would say something like this!

Your method used in previous versions needs to be separated from Screen Input sub, a separate sub that may call ScreenInput if Ctrl+K pressed, then prompt N = Knight, R = Rook, ... I am trying to incorporate all your other changes great and small in my updates because they are usually great!

Man! you have SHOWING ALL legal moves going?!?!!! can't wait to test!  8-)

Title: Re: Hi everybody
Post by: bplus on October 25, 2017, 03:40:51 am
Legal Moves nice and easy to add to new look.

I got pawn promotion worked out along with pieces captured tally, that took some work.

Yes, and the game recorder has been added now too!

For more screen shots:
http://www.thejoyfulprogrammer.com/qb64/forum/showthread.php?tid=1056&pid=4783&rndtime=15089168411347312526#pid4783

Or follow us here:
http://qb64.freeforums.net/thread/81/chess-update