nedoPC.org

Electronics hobbyists community established in 2002
Atom Feed | View unanswered posts | View active topics It is currently 28 Mar 2024 10:19



Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
"Интеллект-02" 
Author Message
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
Интересно, что С.Фролов считает, что "серия "Электроника ИМ-01", "Электроника ИМ-01Т" и "Электроника ИМ-05" - довольно интересные шахматные компьютеры. ... , причем полностью нашей разработки "
С.Фролов wrote:
Одна из первых отечественных электронных игр, причем полностью нашей разработки (ленинградское объединение "Светлана").
...
В нашем шахматном компьютере использовался популярный в 1986 году микропроцессор К1801ВМ1. Это - 16-разрядный микропроцессор, широко применявшийся в компьютерах ДВК-2 или семейства БК-0010. Скорее всего, на ДВК-2 он и отлаживался. Примечательно, что сам процессор - производства московского "Ангстрема". В то время на самой "Светлане" выпускался микропроцессор собственного производства К586ВМ1 для компьютеров серии "С5", и почему они взяли чужой, не понятно. Наверно, из-за той возможности отладки.





24 Jul 2011 12:16
Profile
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
Совершенно неожиданно нашел я на жестком диске шахматы на КвикВасюке! :o
Даже не помнил, что у меня такие были. Никогда не играл... :-?

Image

Что они "хотели сказать" в псевдографике - в упор не пойму... :(
Под Вендой это выглядит так и никак по-другому... В любых шрифтах...

Коротко глянул внутрь - есть короткая вставка в кодах и длинная "бадья" описания...
Code:
'-------------------- This is where the chess books are stored --------------
BookData:
  DATA"*rnbqkbnrpppppppp32PPPPPPPPRNBKQBNR*1","E2E4","75","D2D4"
  DATA"*rnbkqbnrppp1pppp11p7P12PPP1PPPPRNBKQBNR*2","B1C3"
  DATA"*rnbkqb1rppp1pppp5H5p7P9N2PPP1PPPPRNBKQB1R*3","G1F3"
  DATA"*rnbqkbnrpppppppp20P11PPPP1PPPRNBQKBNR*1","E7E5"
  DATA"*rnbqkbnrpppp1ppp12p7P8N2PPPP1PPPRNBQKB1R*2","B8C6"
  DATA"*r1bqkbnrpppp1ppp2n9p7P5N2N2PPPP1PPPR1BQKB1R*3","G8F6"
  DATA"*r1bqkb1rpppp1ppp2n2n6p5B1P5N2N2PPPP1PPPR1BQK2R*4","F8C5"
  DATA"END"
'---------- Comments on the program -----------------------------------------
'     This program was orginally written in interpretive basic and as such
' it employs several things that are no longer in vogue. In Ibasic, a pro-
' gram could be made to run faster by two techinques.. 1. by ordering the
' variables in a Dim statement (the most used variables are accessed first.
' and 2. by putting the most use subroutines at the beginning of the program.
' Ibasic would always look for Gotos and Gosubs by starting at the begining
' of the program until it fould the line number called for.
' I also found that, at least in QBasic, that Gosubs run faster than using
' Sub's.
' Here is a summary of the subroutines used in my program.
' 1. InCheck: is actuall two subs in one. First it locates the king and then
'     is finds all pieces attacking that square. It exits the sub upon finding
'     a attacking piece and that pieces location is in the variable "K".
'     This makes makes the program more useful as it can find attacks on other
'     men by setting their location to "K" and going to Attackers:
' 2. Evualuation: is just what the program infers, and can be changed as
'     by the operator/programmer as desired. The weights are for trial pur-
'     poses only and may not represent the Best.
' 3.  Books: is where the program looks to see if an opening book has been
'      defined by the program. It is not the most efficent, but it works.
'      The books can be expanded simply by hitting Control-Break after the
'      program leaves the book subroutine and generates a move on its own.
'      At this point pressing 'F6' and printing Book$ you can see what the
'      chess board looked like at that point. Simply print that line,
'      then press 'F6' again the paste the line at the end of the program,
'      preceded by a "Data" statement. Then enclose you suggest move in
'      quotes. By adding a number in quotes after the move, you can suggest
'      an alternative move. The number is the percentage of the time the
'      program will chose the first move.
' 4.  Genmoves: is where the program generates all of its legal moves. It
'      castle when it can and make enpassant captures when it is possible and
'      they are advantageous. The first thing the program does is find a man
'      of its own color, then it goes to InCheck to see if that move puts its
'      king in check, if so it rejects the move. If not it then goes to the
'      Evualuate subroutine, rates the move, and stores it as Best if it is
'      determined to actually the best, if not it simply returns to GenMove.
'      After finding its best move it falls into the execute the move and
'      does just that. After making its move it switches sides and determines
'      if the enemy king is in check and goes to HumanInput.
'      In the begining of the computer moves "Best is set to 400 if the
'      the program is in check when it starts is move gen. or 200 if it is
'      not. If after trying to find a legal move and it can't it prints the
'      message CheckMate you win or Stalemate, and then quits.
' 5.  HumanInput: only accepts 4 commands: "Q" for quit, "S" for save the game
'      "L" for loading a previously saved game, or a standard move entered as
'      "E2E4" without spaces, however, it in entering a move, you hit a wrong
'      key before the last digit is entered, you can hit "x" or "z" or
'      any other key and it will void the move and try again. It won't do that
'      unless 4 keystrokes have been entered and back spaces are not allowed.
'      It checks that you are moving your own man and that the move is legal.
'      If so, it makes the move, if not it prints "Illegal" goes back to
'      input again. My legal checking is not 100% true, but if you don't
'      cheat, it should work. After making its move it goes to see if its
'      king is in check and set the approiate flag before going to Books:.
'      If it has no more books stored it goes to GenMoves:.
' 6.   The subroutines following HumanInput are for calculating the position
'      of the chessmen on the board and putting them there. Because some
'      moves require moving more that one man "castling" or enpassant there
'      are some subroutines that only make half a move before making a full
'      move later. DON'T REMOVE THESE SUBROUTINES.
' 7. Initialize: creates the chess board and the centercontol board as:
'            chess board                    centercontrol board
'    99,99,99,99,99,99,99,99,99,99       0, 0, 0, 0, 0, 0, 0, 0, 0, 0
'    99, 0, 0, 0, 0, 0, 0, 0, 0,99       0, 0, 0, 0, 0, 0, 0, 0, 0, 0
'    99, 4, 2, 3, 5, 6, 3, 2, 4,99       0, 0, 1, 3, 4, 4, 3, 1, 0, 0
'    99, 1, 1, 1, 1, 1, 1, 1, 1,99       0, 2, 3, 5, 6, 6, 5, 3, 2, 0
'    99, 0, 0, 0, 0, 0, 0, 0, 0,99       0, 4, 5, 7, 8, 8, 7, 5, 4, 0
'    99, 0, 0, 0, 0, 0, 0, 0, 0,99       0, 6, 7, 9,10,10, 9, 7, 6, 0
'    99, 0, 0, 0, 0, 0, 0, 0, 0,99       0, 6, 7, 9,10,10, 9, 7, 6, 0
'    99, 0, 0, 0, 0, 0, 0, 0, 0,99       0, 4, 5, 7, 8, 8, 7, 5, 4, 0
'    99,-1,-1,-1,-1,-1,-1,-1,-1,99       0, 2, 3, 5, 6, 6, 5, 3, 2, 0
'    99,-4,-2,-3,-5,-6,-3,-2,-4,99       0, 0, 1, 3, 4, 4, 3, 1, 2, 0
'    99,99,99,99,99,99,99,99,99,99       0, 0, 0, 0, 0, 0, 0, 0, 0, 0
'    99,99,99,99,99,99,99,99,99,99       0, 0, 0, 0, 0, 0, 0, 0, 0, 0
'    If the computer is black only       The outside edges of this
'    the signs are refersed. The         board are really not needed as
'    computer is always at the top       only the center square witch
'    of the screen. The #'s 99 are       correspond to the real chess
'    always off the board.               board are accessed.
'                                        However. you can put in any values
'                                        that you want to try as these are
'                                        only starting values based upon
'                                        the value of one pawn = 100
'                                        You can try as high as 150 for the
'                                        center squares if you want.
' A final note:
' I have never taken a class on programming, I am self taught, so some of
' my coding may not be the best. If anyone who uses this program wants to
' makes changes, feel free to do so. If you make it play better, or optimize
' any of the coding, please forward the new version of the program so as I
' can record the changes for future releases. I am giving this program as
' freeware to use as you see fit. At the current time it is not very strong.
' It is only a one-ply program, however, it has been stated that the better
' a program plays at one-ply, the better it will play at depth (many-plys).
' You can Email me at: WROGERS824@AOL.COM any comments or changes.
' I deleted the clock subroutines as they messed up the on-board computer
' clock. I just could not figure out how to do it better at this time.
' The program as it stands now has been in existance for 19 years.
' Thanks to all of you. Bill Rogers.

_________________
iLavr


12 Aug 2012 12:08
Profile
Banned
User avatar

Joined: 04 Jan 2013 10:09
Posts: 397
Location: 95.24.178.158
Reply with quote
Post 
Большое количество ссылок на шахматные программы есть на сайте:
https://chessprogramming.wikispaces.com/6502.

Я посещал его по другому поводу, поэтому не проверял, что там - по этим ссылкам, но потом вспомнил про это обсуждение здесь.

Возможно, ссылки будут кому-либо полезны...


04 Jul 2014 18:07
Profile
Senior

Joined: 26 Oct 2006 04:55
Posts: 178
Location: Москва
Reply with quote
Post 
А кто напишет шахматы на UBASIC?


12 Jul 2014 00:45
Profile
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
Num Lock wrote:
А кто напишет шахматы на UBASIC?

На чистом ...BASIC мне шахматы не попадались, но, возможно, есть шанс перенести их с других ЯВУ?

Два коротеньких примера у нас на форуме есть:

JavaScript chess
Code:
for(B=i=y=u=b=i=5-5,x=10,I=[],l=[];B++<304;I[B-1]=B%x?B/x%x<2|B%x<2?7:B/x&4?0:l[i++]="ECDFBDCEAAAAAAAAIIIIIIIIMKLNJLKM@G@TSb~?A6J57IKJT576,+-48HLSUmgukgg OJNMLK  IDHGFE".charCodeAt(y++)-64:7);function X(c,h,e,s){c^=8;for(var o,S,C,A,R,T,G,d=e&&X(c,0)>1e4,n,N=-1e8,O=20,K=78-h<<9;++O<99;)if((o=I[T=O])&&(G=o^c)<7){A=G--&2?8:4;C=o-9?l[61+G]:49;do if(!(R=I[T+=l[C]])&&!!G|A<3||(R+1^c)>9&&G|A>2){if(!(R-2&7))return K;n=G|(c?T>29:T<91)?o:6^c;S=(R&&l[R&7|32]*2-h-G)+(n-o?110:!G&&(A<2)+1);if(e>h||1<e&e==h&&S>2|d){I[T]=n;I[O]=0;S-=X(c,h+1,e,S-N);if(!(h||e-1|B-O|T-b|S<-1e4))return W(),c&&setTimeout("X(8,0,2),X(8,0,1)",75);I[O]=o;I[T]=R}if(S>N||!h&S==N&&Math.random()<.5)if(N=S,e>1)if(h?s-S<0:(B=O,b=T,0))break}while(!R&G>2||(T=O,(G||A>2|(c?O>78:O<41)&!R)&&++C*--A))}return-K+768<N|d&&N}function W(){i="<table>";for(u=18;u<99;document.body.innerHTML=i+=++u%x-9?"<th width=60 height=60 onclick='I[b="+u+"]>8?W():X(0,0,1)'style='font-size:50px'bgcolor=#"+(u-B?u*.9&1||9:"d")+"0f0e0>&#"+(I[u]?9808+l[67+I[u]]:160):u++&&"<tr>")B=b}W()


И Toledo Nanochess - world's smallest chess program in C
Code:
/**************************************************************************\
| Toledo Nanochess (c) Copyright 2009 Oscar Toledo G. All rights reserved  |
| 1258 non-blank characters. Evolution from my winning IOCCC 2005 entry.   |
| o Use D2D4 algebraic style for movements.  biyubi@gmail.com  Aug/10/2009 |
| o On promotion add a number for final piece (3=N, 4=B, 5=R, 6=Q)         |
| o Press Enter alone for computer to play.                                |
| o Full legal chess moves.                     http://nanochess.110mb.com |
| o Remove these comments to get 1326 bytes source code (*NIX end-of-line) |
\**************************************************************************/
char*l="ustvrtsuqqqqqqqqyyyyyyyy}{|~z|{}"
"   76Lsabcddcba .pknbrq  PKNBRQ ?A6J57IKJT576,+-48HLSU";
#define F getchar()&z
#define v X(0,0,0,21,
#define Z while(
#define _ ;if(
#define P return--G,y^=8,
B,i,y,u,b,I[411],*G=I,x=10,z=15,M=1e4;X(w,c,h,e,S,s){int t,o,L,E,d,O=e,N=-M*M,K
=78-h<<x,p,*g,n,*m,A,q,r,C,J,a=y?-x:x;y^=8;G++;d=w||s&&s>=h&&v 0,0)>M;do{_ o=I[
p=O]){q=o&z^y _ q<7){A=q--&2?8:4;C=o-9&z?q["& .$  "]:42;do{r=I[p+=C[l]-64]_!w|p
==w){g=q|p+a-S?0:I+S _!r&(q|A<3||g)||(r+1&z^y)>9&&q|A>2){_ m=!(r-2&7))P G[1]=O,
K;J=n=o&z;E=I[p-a]&z;t=q|E-7?n:(n+=2,6^y);Z n<=t){L=r?l[r&7]*9-189-h-q:0 _ s)L
+=(1-q?l[p/x+5]-l[O/x+5]+l[p%x+6]*-~!q-l[O%x+6]+o/16*8:!!m*9)+(q?0:!(I[p-1]^n)+
!(I[p+1]^n)+l[n&7]*9-386+!!g*99+(A<2))+!(E^y^9)_ s>h||1<s&s==h&&L>z|d){p[I]=n,O
[I]=m?*g=*m,*m=0:g?*g=0:0;L-=X(s>h|d?0:p,L-N,h+1,G[1],J=q|A>1?0:p,s)_!(h||s-1|B
-O|i-n|p-b|L<-M))P y^=8,u=J;J=q-1|A<7||m||!s|d|r|o<z||v 0,0)>M;O[I]=o;p[I]=r;m?
*m=*g,*g=0:g?*g=9^y:0;}_ L>N){*G=O _ h&&c-L<0)P L;N=L _!h&s>1)i=n,B=O,b=p;}n+=J
||(g=I+p,m=p<O?g-3:g+2,*m<z|I[p+=p-O]|m[p<O?1:-1]);}}}}Z!r&q>2||(p=O,q|A>2|o>z&
!r&&++C*--A));}}}Z++O>98?O=20:e-O);P N+M*M&&N>-K+1924|d?N:0;}main(){Z++B<121)*G
++=B/x%x<2|B%x<2?7:B/x&4?0:*l++&31;Z B=19){Z B++<99)putchar(B%x?l[B[I]|16]:x)_
x-(B=F)){i=I[B+=(x-F)*x]&z;b=F;b+=(x-F)*x;Z x-(*G=F))i=*G^8^y;}else v u,5);v u,
1);}}

_________________
iLavr


12 Jul 2014 09:10
Profile
Banned
User avatar

Joined: 04 Jan 2013 10:09
Posts: 397
Location: 95.24.178.158
Reply with quote
Post 
Lavr wrote:
Num Lock wrote:
А кто напишет шахматы на UBASIC?

На чистом ...BASIC мне шахматы не попадались, но, возможно, есть шанс перенести их с других ЯВУ?

Если уж переносить, то может быть, проще это сделать с более близкого языка?

Вот здесь есть исходники шахматного проекта на vBasic:
http://sourceforge.net/projects/vb6chess/files/latest/download

Я, правда, не совсем понял, какой UBASIC имеется в виду?


12 Jul 2014 10:51
Profile
Senior

Joined: 26 Oct 2006 04:55
Posts: 178
Location: Москва
Reply with quote
Post 
Тот самый, японский и под DOS.


12 Jul 2014 22:37
Profile
Banned
User avatar

Joined: 04 Jan 2013 10:09
Posts: 397
Location: 95.24.178.158
Reply with quote
Post 
Num Lock wrote:
Тот самый, японский и под DOS.

Я, к сожалению, сделать такого переноса за короткое время не смогу.

Хотя я скачал и опробовал: Simple Chess VB.

Могу только сказать, что на мой взгляд, перенос на QBASIC 4.5 DOS возможен, даже не вникая в алгоритм - механически и по аналогии.
А вот с UBASIC японским и под DOS - мне столкнутся не пришлось.


13 Jul 2014 11:26
Profile
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Lavr wrote:
3 - нелогичные, глупые ходы машины...
...
Машина думает... и... БЬЁТ КОРОЛЯ !!!! :D

Я вобще в шахматы играю плохо... но сегодня случилась у меня занимательная партия с Протезусом!.. :o
Я поэтому раньше никогда особо не проверял, как играют в шахматы модели Протезуса, поскольку сам плохо играю.

Но сегодня я модель LCD разрабатывал и пришлось подсматривать, почему у меня мусор по краям LCD вылезает,
а в моделях LCD Протезуса мусора незаметно...
Ну и для динамики LCD играл я с ним в шахматы ну так... особо не утруждаясь...

И как-то так вышло, что я вдруг шах объявляю конем его королику!... :o
А он вместо того, чтобы отойти или прикрыться ну или сдаться, если что не так, вдруг нападает своим
ферзем на моего ферзя! :roll:

Я аж опешил и растерялся... ну мой-то ферзь - под защитой, а его королик-то всё также под боем! :lol:

Поэтому я взял и его королика так и СЪЕЛ! конем!! :esurprised:
Attachment:
ProCHESS.gif
ProCHESS.gif [ 16.44 KiB | Viewed 8744 times ]

А он - раз уж пошла такая пьянка - нет бы отомстил-таки мне... и всё же СЪЕЛ моего ферзя!!! 8)
Нет... он ферзем отскочил и собрался продолжать играть!!! :mrgreen:

В общем, шахматы у Протезуса из того же источника, что и у "Специалиста"... Я "смиялься нипадецки"... :ebiggrin:

_________________
iLavr


28 Jan 2016 12:54
Profile
Online
Admin
User avatar

Joined: 08 Jan 2003 23:22
Posts: 22410
Location: Silicon Valley
Reply with quote
Post Re:
Lavr wrote:
И Toledo Nanochess - world's smallest chess program in C
Code:
/**************************************************************************\
| Toledo Nanochess (c) Copyright 2009 Oscar Toledo G. All rights reserved  |
| 1258 non-blank characters. Evolution from my winning IOCCC 2005 entry.   |
| o Use D2D4 algebraic style for movements.  biyubi@gmail.com  Aug/10/2009 |
| o On promotion add a number for final piece (3=N, 4=B, 5=R, 6=Q)         |
| o Press Enter alone for computer to play.                                |
| o Full legal chess moves.                     http://nanochess.110mb.com |
| o Remove these comments to get 1326 bytes source code (*NIX end-of-line) |
\**************************************************************************/
char*l="ustvrtsuqqqqqqqqyyyyyyyy}{|~z|{}"
"   76Lsabcddcba .pknbrq  PKNBRQ ?A6J57IKJT576,+-48HLSU";
#define F getchar()&z
#define v X(0,0,0,21,
#define Z while(
#define _ ;if(
#define P return--G,y^=8,
B,i,y,u,b,I[411],*G=I,x=10,z=15,M=1e4;X(w,c,h,e,S,s){int t,o,L,E,d,O=e,N=-M*M,K
=78-h<<x,p,*g,n,*m,A,q,r,C,J,a=y?-x:x;y^=8;G++;d=w||s&&s>=h&&v 0,0)>M;do{_ o=I[
p=O]){q=o&z^y _ q<7){A=q--&2?8:4;C=o-9&z?q["& .$  "]:42;do{r=I[p+=C[l]-64]_!w|p
==w){g=q|p+a-S?0:I+S _!r&(q|A<3||g)||(r+1&z^y)>9&&q|A>2){_ m=!(r-2&7))P G[1]=O,
K;J=n=o&z;E=I[p-a]&z;t=q|E-7?n:(n+=2,6^y);Z n<=t){L=r?l[r&7]*9-189-h-q:0 _ s)L
+=(1-q?l[p/x+5]-l[O/x+5]+l[p%x+6]*-~!q-l[O%x+6]+o/16*8:!!m*9)+(q?0:!(I[p-1]^n)+
!(I[p+1]^n)+l[n&7]*9-386+!!g*99+(A<2))+!(E^y^9)_ s>h||1<s&s==h&&L>z|d){p[I]=n,O
[I]=m?*g=*m,*m=0:g?*g=0:0;L-=X(s>h|d?0:p,L-N,h+1,G[1],J=q|A>1?0:p,s)_!(h||s-1|B
-O|i-n|p-b|L<-M))P y^=8,u=J;J=q-1|A<7||m||!s|d|r|o<z||v 0,0)>M;O[I]=o;p[I]=r;m?
*m=*g,*g=0:g?*g=9^y:0;}_ L>N){*G=O _ h&&c-L<0)P L;N=L _!h&s>1)i=n,B=O,b=p;}n+=J
||(g=I+p,m=p<O?g-3:g+2,*m<z|I[p+=p-O]|m[p<O?1:-1]);}}}}Z!r&q>2||(p=O,q|A>2|o>z&
!r&&++C*--A));}}}Z++O>98?O=20:e-O);P N+M*M&&N>-K+1924|d?N:0;}main(){Z++B<121)*G
++=B/x%x<2|B%x<2?7:B/x&4?0:*l++&31;Z B=19){Z B++<99)putchar(B%x?l[B[I]|16]:x)_
x-(B=F)){i=I[B+=(x-F)*x]&z;b=F;b+=(x-F)*x;Z x-(*G=F))i=*G^8^y;}else v u,5);v u,
1);}}


По шахматам от Оскара Толедо завёл отдельную тему:

http://www.nedopc.org/forum/viewtopic.php?f=81&t=11296

Там кстати чуть более новая версия - от ноября 2009

_________________
:dj: https://mastodon.social/@Shaos


28 Jan 2016 13:31
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 25 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 11 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.