Brad Nelson
Administrator
עַבְדְּךָ֔ אֶת־ הַתְּשׁוּעָ֥ה הַגְּדֹלָ֖ה הַזֹּ֑את
Posts: 12,261
|
Post by Brad Nelson on Nov 9, 2020 14:19:10 GMT -8
I’ve been playing a version of Parcheesi (Pachisi) on my old retro gaming system (a PowerBook G3). And I thought an enlargement of some kind of artful Parcheesi board would look good on the wall…maybe next to my M.U.L.E. poster. If you search the web, you’ll find all kinds of cool and unique Parcheesi board designs. But I ran across one that I thought was good looking enough, and high resolution enough, to blow up. Here’s the original. I did some Photoshop work to touch up the art. But I first used an online AI jpg enlargement utility to boost the resolution. And I got pretty good results. Here’s the finished product. Enlarged VersionI had planned on putting it on the wall. But I laid it on my rolltop desk just to set it somewhere safe while I figured out what to do with it. And then it occurred to me that it was the same width as the piece of glass that was already on the desk and that front-to-back it was about a perfect fit as well. And the brown tones seem to match the desk well, so there it has found a home where I least expected it.
|
|
Brad Nelson
Administrator
עַבְדְּךָ֔ אֶת־ הַתְּשׁוּעָ֥ה הַגְּדֹלָ֖ה הַזֹּ֑את
Posts: 12,261
|
Post by Brad Nelson on Jul 13, 2023 17:31:50 GMT -8
This is a program written in Atari BASIC that will deal five random cards.
I may talk about this later. I just wanted to see if the "code" tags preserved indents. 5 REM "H2:SHUFF2.LST" 10 DIM S$(4),N$(13),U(52),D(14),V$(13) 20 N$="A23456789TJQK" 30 REM Not needed V$="\01\02\03\04\05\06\07\08\09\0A\0A\0A\0A" 40 S$="` {" 50 FOR X=0 TO 5 : REM if 5, will load 5 cards; max is 14 as limited by D 60 N=0 70 WHILE N=0 80 Y=RAND(52) 90 IF (U(Y)=0) : REM check if card already picked; 0 = not picked 100 D(X)=Y : REM store the randomly chosen cards 110 U(Y)=1 : REM mark in 52 deck array as used with a 1 120 N=1 : REM set N to exit WEND loop and get the next X 130 ENDIF 140 WEND 150 NEXT X 160 FOR P=1 TO 5 : REM if 5 will print 5 cards : REM Max is 14 170 N=D(P) MOD 13+1 180 M=D(P) DIV 13+1 190 ? N$(N,N);" OF ";S$(M,M) 200 NEXT P
|
|
Brad Nelson
Administrator
עַבְדְּךָ֔ אֶת־ הַתְּשׁוּעָ֥ה הַגְּדֹלָ֖ה הַזֹּ֑את
Posts: 12,261
|
Post by Brad Nelson on Jul 14, 2023 8:07:13 GMT -8
Other than hand-crafted items, there is probably little in this commercial world that is made that doesn't involve a computer program of some type. I'm not particularly good at programming. I'm a little dense, in fact. I don’t "see" the quickest, most elegant solutions. I tend toward brute force. And I approach it as a fun puzzle. I have done some programming that has been useful. But mostly I dabble in it for fun. It's a way to peek behind the curtain to see how this normally hidden side of the world works. But it is a specialized field populated by mostly males with Bobby Fischer-like brains (to some degree). They have amazing talent. However, most people make productive use of machines built by programming (or run directly by programs) and need know relatively little about the underlying software. Programmers, if they are good (and kind), will build a "user interface" that allows the user to make good use a tool with little or no need to memorize arcane commands and such. But programming itself is inherently arcane. Although so-called higher-level languages have simplified programming greatly, this is "simple" only in contrast to such things as assembly language whereby you literally manipulate registers in the microprocessor one bit of hexadecimal code at a time using a few dozen three-letter mnemonics. Even this is a step up from true machine language which would consist of feeding the machine basically zeros and ones. Such code would be all but unreadable (and thus unusable) to all by the highest savants. Even assembly code is a challenge to makes sense of (example below). But these days they have languages such as C++ (or C, or C#), Python, and Java which make up the bulk of the languages used. They are "friendly" in the sense that they are at least a couple levels of abstraction above machine language. And from what I understand, these languages (and their compilers) have become so sophisticated, they can produce code that is often faster than machine language or assembly (which historically is used for important drivers and such where speed is a must). A typical case for understanding how to make a language work is to write a program that writes "Hello World" onto the screen. This is how it looks in 6502 assembly language (the 6502 is the microprocessor used in early Apple, Atari, Commodore, and many other computers): ; goodbyeworld.s for C= 8-bit machines, ca65 assembler format. ; String printing limited to strings of 256 characters or less.
a_cr = $0d ; Carriage return. bsout = $ffd2 ; C64 KERNEL ROM, output a character to current device. ; use $fded for Apple 2, $ffe3 (ascii) or $ffee (raw) for BBC. .code
ldx #0 ; Starting index 0 in X register. printnext: lda text,x ; Get character from string. beq done ; If we read a 0 we're done. jsr bsout ; Output character. inx ; Increment index to next character. bne printnext ; Repeat if index doesn't overflow to 0. done: rts ; Return from subroutine.
.rodata
text: .byte "Hello world!", a_cr, 0 The above is the "source code" that the programmer writes (which later gets "compiled" into a form that that can be "run" and thus understood by the computer). The actual statements to the processor (to the compiler, really...the compiler will turn this assembly code into basically ones and zeros) are the three-letter mnemonics in the second column (plus some arguments, often using labels).
The rest of the code consists of "labels" (in the first column) and comments in the rightmost column (anything that follows the ";" is a comment). That is, 3/4 of the above is an attempt to make it human-readable and has nothing (directly) to do with telling the computer processor what to do. Did I mention "inherently arcane"?
And even this bit of 6502 assembly code is relatively short and straightforward compared to what you'd need to do the same thing on an old Atari 2600 game console or an Atari 800. It's really a wonder that there is so much good software (including games) that is written at all. It is an enormously daunting task, even if modern languages make it relatively simple. Written in the BASIC programming language, this is all you need to do. 1) Turn on the computer (which might automatically boot into BASIC as the Atari, Apple II, Commodore and other computers do). 2) Type: 10 print "Hello World" 3) Type "Run" and the above one-line program will run and print "Hello World" on the screen. BASIC is a learner's language although modern forms (and computers) are certainly fast enough that it is still useful. The post previous to this includes a listing for a BASIC program (Atari Basic) that will deal 5 cards to you at random. I found the program online, adapted it a bit to make it work outside of someone's Twitter engine, and then set about trying to understand it. Like I said, I am a bit dense in this regard, and that's not false modesty talking. But part of the challenge (fun?) of being a programmer is that it is often a pissing contest. The point is not to teach or make some bit of code readable. It is to show off one's virtuosity. Readability of the code (all the comments to this code are mine) is not needed or perhaps even desirable. The point is to come up with something that is concise and relatively elegant. Think of giving someone directions for how to get to the airport. The most concise and "elegant" way would be to point directly to the airport as the crow flies (and this indeed would be correct). Or you could spend an enormous amount of time explaining (and mapping out) the exact route so that the other person could actual understand and get there. That's sort of how "programming virtuosity" is a pissing contest. And I'll admit it can be difficult to distinguish from just a hefty brain doing what is skillful work and what is a pissing contest. But if is often the case for programs you find online that a lot of piss is involved. You have to figure it out. And so I did and it took a fair amount of time to deconstruct this guy's program. I'll post more about that later.
|
|
|
Post by kungfuzu on Jul 14, 2023 17:00:20 GMT -8
Do I understand correctly, that whole page of code is required to write "Hello World" on to the computer screen?
|
|
|
Post by artraveler on Jul 14, 2023 17:00:47 GMT -8
Think of giving someone directions for how to get to the airport. The most concise and "elegant" way would be to point directly to the airport as the crow flies (and this indeed would be correct). I'm reminded of a joke I heard about 30 years ago. A commuter helicopter was flying to SEATAC and got lost in the fog. The pilot seeing a brightly lit building flys towards it and hovers. He holds up a sign, "where am I ?" The people in the building huddle around and hold up a sign, "you are in a helicopter" The pilot nods his head and flys directly to the airport. The passengers are amazed, "how did you know where to go from that little bit of useless information, they asked. The pilot replied, "not entirely useless, but entirely correct. That told me it was the Microsoft building and from there to the airport was easy. I've heard most skilled programmers are Yankees. If you have ever gotten directions from a Southerner you'll understand the saying of getting there is half the fun. Yankee driver, "how do I get to the Smith place?" Rebel farmer, "which Smith, the one married or the one not married, or the on with red hair? After deterring which Smith the directions follow. Take the road down to the fallen oak tree, that's just past the broken mailbox on the left. Turn right and drive a piece to what used to be Nelson's farm. Go up the hill and stop and ask the guy in the tractor where you are.
|
|
Brad Nelson
Administrator
עַבְדְּךָ֔ אֶת־ הַתְּשׁוּעָ֥ה הַגְּדֹלָ֖ה הַזֹּ֑את
Posts: 12,261
|
Post by Brad Nelson on Jul 15, 2023 8:19:13 GMT -8
In the case of assembly language, yes. Even in the cases (as in BASIC) where it's no more complicated than typing Print "Hello World", there is a whole lot of software going on in the background that was written by someone else to make it this easy.
Few program in assembly language anymore. The so-called "higher languages" are used. They make things easier because, as with BASIC, they're built upon a whole bunch of hierarchical layers of automated software. And that's how it should be. You really wouldn't want to have to recreate the wheel each time you wanted to move the cart.
The equivalent of assembly language is to gather the raw ore, refine it, forge the metal for a saw blade, hammer it flat, cut its teeth, and then mount it to a handle. Then you could cut down the tree.
BASIC supplies the saw as a given. The same with other "higher" languages. And other than BASIC, there's still some arcane overhead and housekeeping that you have to do with these "higher" languages in order to use them. And obviously the world is full of tremendously complicated and useful software so it is getting the job done and plenty have no trouble figuring it all out, although much of it remains quite arcane to me.
I believe the complexity of it is still considered a feature. For decades (before the personal computer) there was a "Geek Aristocracy" that loved the fact that you had to go through them to use computers. At most, workers will supplied with "dumb" terminals that accessed the mainframe housed in the central "temple" of information technology experts. But you were wholly dependent upon what this Geek Aristocracy wanted you to see and use.
Although Steve Jobs was a first-rate asshole (there isn't much utility in being a second-rate one), he did help to break this Geek Aristocracy and usher in the era of personal computers. That we are sort of back to chaining ourselves again via the Tech Aristocracy is ironic but of absolutely no surprise to Mr. Kung and his Rules of Life. There's a rule in there, I'm sure, about aristocracies always arising and trying to control people.
|
|
Brad Nelson
Administrator
עַבְדְּךָ֔ אֶת־ הַתְּשׁוּעָ֥ה הַגְּדֹלָ֖ה הַזֹּ֑את
Posts: 12,261
|
Post by Brad Nelson on Jul 15, 2023 8:41:48 GMT -8
That anecdote is also told by Dave Plummer, a Microsoft millionaire who has a YouTube channel and self-identifies as autistic. I don't know why he doesn't just take his millions and call it good. But as I told him once (in a less direct way): Why identify as "autistic" when you have a special gift that allowed you to have a successful career as a top programmer?
I guess living in and around Seattle, you can't be normal. You have to be a "victim" of some type. But he told this same story and I think it may not be apocryphal.
|
|
|
Post by kungfuzu on Jul 15, 2023 9:29:17 GMT -8
Back in 1983, Mdm Flu, when she was still Mademoiselle, was close friends with the wife of one of the top Apple executives in Singapore. As I recall, he had been one of the first one-or-two thousand employees of the company. In any case, he must have done very well as he retired a few years later after having returned to Cupertino, and he was max. ten years older than I. (I just checked and he is 7 years older than I. Still in Cupertino.)
In any case, we visited their home for Thanksgiving Dinner and he and I got into a discussion on the utility of PCs at that time. He wondered why I didn't use one. I said something like this, "The moment you people come up with a computer that doesn't require me to write in some code to use it, is when I will start using a PC."
He immediately told me that Apple was working on exactly that problem and would have such a product in the near future. I didn't know it at the time, but he was referring to the Macintosh, which came out in 1984.
It took some years for me, personally, to start using a PC. Among other things, I had to teach myself to type on a typing program, but we were using PCs in our Hongkong office by around 1987. We even had a computer link to our bank for issuing letters of credit without having to fill out all the paperwork and physically take it to the bank. Believe me, that was very advanced for the time.
|
|
Brad Nelson
Administrator
עַבְדְּךָ֔ אֶת־ הַתְּשׁוּעָ֥ה הַגְּדֹלָ֖ה הַזֹּ֑את
Posts: 12,261
|
Post by Brad Nelson on Jul 15, 2023 10:37:48 GMT -8
The thing about programming is that it is about breaking up tasks into discrete steps. Although the specific commands in the language of BASIC might not be familiar to you, as a non-lunatic traditional America, you understand the concept of steps, why they are necessary, and how to reason from one to another in order to get something useful done and not waste a lot of time. If you weren't, you would find it very easy to be a Socialist who just wishes for an emotional Utopia, completely unconcerned about the problematic nature of the steps to get there (and probably unconcerned about bathing as well), if in fact he has thought about steps at all. The steps a computer must take are usually smaller than the ones we map out for ourselves when we do something because we operate on a very "high" language indeed. If I say "Take a left" to you, you know it means to make a left turn at the next intersection. A computer might indeed have a verb for the equivalent of "take" but it will be left wondering what a "left" is unless you've already defined it. That sort of thing. It's describing over the telephone to someone how to tie a tie. You've learned the steps and have done it so often, you don't even think about it. Thus the difficulty comes when you then have to think in terms of steps and can't just say to someone over the telephone "Do it like this." You'll find that there could be a very many small steps that you have to unambiguous communicate to that person on the other end of the line. So how do you get a computer to deal five random cards to you? Whatever the specific commands and syntax of a language, usually any worthy software problem first gets parsed into more human-understandable terms – as in some kind of basic flowchart (even if it's just one you keep in your head). The computer has an easy function to produce a random number. That will come in handy. But it knows nothing about a deck of cards, nor about denominations and suits. You have to somehow create that (or simulate that) from scratch. We're not worried about drawing the graphic of a card. That is a completely different task and, in some ways, far easier. It would be enough for the computer simply to spit out something like this: "AH, 2S, 5H, KC". (Ace of hearts, 2 of spades, five of hearts, King of clubs, etc.). So you might envision the problem like this: 1) Create a deck of cards using whatever BASIC commands can hold this information (an array seems logical) 2) Pick five of these cards at random 3) Print them out on the screen That's pretty much it. And yet there are some interesting complexities that pop up. For instance, you'd be shot at the poker table if you were to have in your hand, for instance, two Aces of Club. Somehow you must keep track of which cards you have already randomly picked. With real cards, when they are dealt from a deck, they go missing from the deck and thus can't be dealt twice. But a computer never forgets unless you tell it to. And if we deal a card from this virtual deck, we must find a way to mark that is has already been dealt. If these were real cards (and we kept them in the deck, simply announcing to people what their card was), we could just put a check on them with a red felt marker. And that's pretty much what you can do with a computerized virtual deck of cards...although you could certainly envision a system whereby that one card was erased from the virtual deck so that it could not be chose again. In the program listed above, the programmer took the "mark with a felt tip pen" approach. But it's not the only approach. Why this and not another? I really won't know until I try to program the alternative method. An array is like a big chest of drawers. For a deck of cards, we could create an array that could hold 52 "drawers." Each drawer could hold some information. In this case, each drawer would hold information on both the denomination and the suit of a card. The first drawer (if we fill them in order) is the Ace of Clubs. The second drawer is the 2 of Clubs. We wrap up to the 14th drawer which is the Ace of Hearts. The 15th drawer is the 2 of Hearts, on up to the last (and 52nd) card (depending upon how we order the suits) which is the King of diamonds. Creating the deck might look like this: 5 CLS ! clear the screen 10 DIM CARDS$(52) ! create an array of 52 "drawers", one for each card 20 CARDS$(1)="AH" ! assign the first three cards manually/proof of concept 30 CARDS$(2)="2H" !(all 52 could be assigned later in an automated way) 35 CARDS$(3)="3H" 45 FOR X = 1 TO 52 ! print out these cards using the "for/next" loop 46 IF CARDS$(X)="" THEN END ! terminate loop if "drawer" is empty 50 PRINT CARDS$(X);", "; 55 NEXT X This was done in Microsoft Basic II on an Atari emulator on my PC. Atari Basic doesn't do "string arrays" well. That's one reason the programmer in that initial program (using Atari Basic) that I listed did it another way, which I will get into later. When I run the above program it prints out: AH 2H 3H. Next would be to add a way to choose them randomly (as well as to mark the cards that have previously been "dealt").
---
There's nothing too arcane in the above. You just have to familiarize yourself with the commands and syntax.
In BASIC, each program line starts with a number. It is conventional to list them 10, 20, 30, etc., but you can number each line anything you want.
"DIM CARDS$(52)" is one of those instances of being handed the finished saw instead of making one yourself. Although the verbiage looks arcane, it's saying nothing more than, "DIMension an array 52 'drawers' high and call that chest of drawers 'CARDS$'.
The precise name of the first drawer is CARDS$(1). The second drawer is CARDS$(2), and so on.
The for/next loop definitely looks arcane. But it's just counting that "x" (starting at one) and incrementing it until it gets to 52. The first time through the loop the value of "x" is "1." The second time through the loop, it is "2", etc. That "x" works as a variable in printing out the cards. So when "x" is "3" and you come to "Print CARDS$(x)", it will actually "Print CARDS$(3)" which in this case is 3H (three of hearts), as specifically defined on line 35.
|
|
Brad Nelson
Administrator
עַבְדְּךָ֔ אֶת־ הַתְּשׁוּעָ֥ה הַגְּדֹלָ֖ה הַזֹּ֑את
Posts: 12,261
|
Post by Brad Nelson on Jul 15, 2023 10:58:05 GMT -8
What an amazing slice of history at a time when Big Things were coming fast, especially in computers.
|
|
Brad Nelson
Administrator
עַבְדְּךָ֔ אֶת־ הַתְּשׁוּעָ֥ה הַגְּדֹלָ֖ה הַזֹּ֑את
Posts: 12,261
|
Post by Brad Nelson on Jul 15, 2023 14:16:31 GMT -8
It's too hot to do much outside (about 90 right now) so I worked some more on replicating the function of that original code I found on the net which dealt five random playing cards. I used Microsoft Basic II on the Atari 800 XL via an emulator on my PC. I thought my "brute force" approach would be much longer than the other program which has some elegant aspects to it. But it was the same 21 lines. The code below is longer because I've extended it to deal a hand to three people. It took a while to get the bugs out of it, but here is the first run (with formatting that could stand to be improved): I haven't even looked at the results until now to see who won. I would need to heavily comment the following code (my code) to make it understandable. I might do that for my own sake. But this was a fun exercise in doing it. The only real complicated parts are those nested for/next loops. That can make it difficult to see what is going on. But it works. And this could somewhat easily be extended to a poker game where you discard cards and draw more, etc. There could even be some light gambling involved. And because you can transparently see the program, you know you can trust your money to it. 10 REM "H2:CARDS6.MSB" 20 RANDOMIZE 30 CLS 40 COUNT=1:Z=1 50 DIM CARDS$(52),DENOMS$(13),SUIT$(4),PLAYER$(3) 60 DENOMS$="A23456789TJQK" 70 SUIT$="HDCS" 80 FOR Y = 1 TO 4 90 FOR D = COUNT TO COUNT+12 100 CARDS$(D)=MID$(DENOMS$,Z,1)+MID$(SUIT$,Y,1) 110 Z=Z+1 120 NEXT D 130 COUNT=COUNT+13 140 Z=1 150 NEXT Y 155 FOR GAMER = 1 TO 3 160 FOR X = 1 TO 5 170 R=RND(52) 180 IF CARDS$(R)="" THEN END 185 IF MID$(CARDS$(R),3,1)="*" THEN GOTO 170 190 PLAYER$(GAMER)=PLAYER$(GAMER)+CARDS$(R)+" " 200 CARDS$(R)=CARDS$(R)+"*" 210 NEXT X 215 NEXT GAMER 220 PRINT "BRAD ";:PRINT PLAYER$(1) 230 PRINT "KFF ";:PRINT PLAYER$(2) 240 PRINT "ARTLER ";:PRINT PLAYER$(3)
|
|
|
Post by kungfuzu on Jul 15, 2023 17:47:31 GMT -8
Don't come to Texas in the summer. I mowed the front lawn a couple of days back after 8 pm. It was still 95 degrees. I rarely go out during the day for more than a few minutes. It is simply too hot and I am doing all I can to avoid worsening my skin cancers. But the draw back of doing yard work in the evening is that the mosquitoes are out in force.
|
|
|
Post by artraveler on Jul 15, 2023 19:29:10 GMT -8
Don't come to Texas in the summer Much the same here in Fayetteville, as I write at 21:40, it is 78 F the high was 90 F and the low will be about 65-68 F with humidity about 80%. People without A/C must be sweltering. It is said you get used to the 90/80 days, temp and humidity. Don't believe it. Without a natural sea breeze it's hot and uncomfortable. And it will be for at least 6 weeks. Been this way here since, well creation. Those of us who live in the South have learned to live with it, but it doesn't mean we like it. It is just that it is balanced out by the Fall and Spring when there are few bugs, pleasant sun and cool nights just right for sleeping and other nocturnal activities. Southerners, and I include Texans, know a special joy to every season. In the Ozark's, we do actually have four seasons, sometimes in the same day. Summer is early morning fishing, afternoon bowling and pool and evening is drive in movies, supplanted with a little rum added to the concession stand coke. Another thing, all carbonated beverages are called Coke. Even if the label says Pepsi. Fall is a special season when it is still polo shirts in the day and a light windbreaker at night. Razorback football and High school football on Friday night. High school games often draw as many as 20,000 in Fayetteville. A considerable crowd as our high school has about 1,700 students. Lots of high school grads and undergrads. Fishing, and bowling are still on the schedule but the fishing has moved to later in the day and bowling has gone to the winter leagues. Winter, say from Thanksgiving to the ides of March can be challenging. But, there is deer hunting, still fishing but limited hours, as when the wind blows it is just miserable. Winter bowling which continues into the late spring. Winter leagues end about the time school is out in late May/early June. The challenge with spring is the storms. As the ground heats up and moisture flows in from the gulf we get some terrific electrical storms and the occasional tornado. It has been 40 years since Fayetteville had a tornado. The closest was two years ago in Springdale and that was an F-2. Tore up some trees and damaged a couple of houses. Fayetteville is hill country, while that doesn't always mean we can't have a tornado it does seem to limit them. There are more tornados in Johnson county, flatland near the Arkansas River, in a year than we have had in the last 100 years. Texans, especially East texans share some of the same conditions. The only thing we really don't like is the ice storm. These happen about once every ten to fifteen years. The last severe ice storm was 2008. Shut down the city for a week. Power was out all over the area, except the university. I was still working so I moved into my office, showered in the student union gym and ate in the food court. All the electrical for the university was underground and some buildings had generators, the older dorms. Some trees fell from the weight of the ice, in some places over one inch thick. It was a good week before I could go back home. If I had been stuck at home It would have been cold. If we have another wife and I are both moving into the Chem E offices for the duration. Ice and crippled up old people don't mix.
|
|
Brad Nelson
Administrator
עַבְדְּךָ֔ אֶת־ הַתְּשׁוּעָ֥ה הַגְּדֹלָ֖ה הַזֹּ֑את
Posts: 12,261
|
Post by Brad Nelson on Jul 15, 2023 19:32:20 GMT -8
Here is the revised Algore-rhythm for dealing five cards to three players as well as the next deal of cards: ---------------------------- ensure real randomization, clear the screen, set the variables 20 RANDOMIZE 30 CLS 50 DIM CARDS$(52),PLAYER$(3) ----------------------------read 52 cards into the string variable CARDS$ ----------------------------one at a time from the DATA statements ----------------------------thus creating a deck of cards 80 FOR Y = 1 TO 52 90 READ CARDS$(Y) 150 NEXT Y ----------------------------choose 5 random cards for each player, ----------------------------make sure they are unique, ----------------------------put into the (PLAYER$) hand 155 FOR GAMER = 1 TO 3 160 FOR X = 1 TO 5 170 R=RND(52) 180 IF CARDS$(R)="" THEN END 185 IF MID$(CARDS$(R),3,1)="*" THEN GOTO 170 186 IF MID$(CARDS$(R),2,1)="H" THEN CARDS$(R)=MID$(CARDS$(R),1,1)+CHR$(0) 190 PLAYER$(GAMER)=PLAYER$(GAMER)+CARDS$(R)+" " 200 CARDS$(R)=CARDS$(R)+"*" 210 NEXT X 215 NEXT GAMER -------------------------print out the results 220 PRINT "BRAD ",:PRINT PLAYER$(1) 230 PRINT "KFF ",:PRINT PLAYER$(2) 240 PRINT "ARTLER ",:PRINT PLAYER$(3) 245 END ------------------------ the data 250 DATA AH,2H,3H,4H,5H,6H,7H,8H,9H,TH,JH,QH,KH 260 DATA A`,2`,3`,4`,5`,6`,7`,8`,9`,T`,J`,Q`,K` 270 DATA A#,2#,3#,4#,5#,6#,7#,8#,9#,T#,J#,Q#,K# 280 DATA A{,2{,3{,4{,5{,6{,7{,8{,9{,T{,J{,Q{,K{ I ran across by chance the technique of using "DATA" statements (lines 250 to 280) to load the cards into the array...sort of a manual technique. This was simpler, although both work. Atari has special graphic characters for the four suits. They do not transfer to the PC. But if you were to read the DATA statements, after the numbers you would see little graphic symbols in the original computer listing (in the Atari emulator), exactly like the screenshot above. That is, except for the hearts. The heart is used as a "null" character for string variables in the system. It's hard-wired. It's the alphabetic equivalent of a "zero". So if I tried to load "2[heart graphic]" into the one of the placeholder string variables, it would just – poof – disappear into nothing. So I had to actually load the regular "H"'s (as you see in line 250) and then convert them at the last moment to graphic hearts (line 186). A workaround but that's sort of typical of this kind of stuff. Place your bets on the next round.
|
|
|
Post by kungfuzu on Jul 15, 2023 22:26:15 GMT -8
When foreigners asked me about the weather in Singapore I used to tell them that it was 90/90. 90 degrees heat and 90 percent humidity. I did not get used to it even after living there for 12 years.
When asked if Singapore had four seasons I would respond, "Yes, wet and wetter and hot and hotter." People generally like that. Yep. Even if it is 7-Up. We share those as well. When I was young, before moving overseas, I think we could count on a good ice-storm every 5-to-10 years or so. Really bad ones every 10-t0-15 years as you mentioned. An ice storm hit us in North Texas a day or so before The Super Bowl at what is now called ATT Stadium in Arlington. I think this was about 10 years back. Apparently, the NFL is not keen to have another Super Bowl there as the weather spooked them.
The freeze we had a couple of years back was one of the worst in history, but there wasn't a huge amount of ice around.
|
|
|
Post by artraveler on Jul 16, 2023 7:40:39 GMT -8
The summer weather forecast for SE Asia, wet and hot. The winter forecast hot and wet.
|
|
Brad Nelson
Administrator
עַבְדְּךָ֔ אֶת־ הַתְּשׁוּעָ֥ה הַגְּדֹלָ֖ה הַזֹּ֑את
Posts: 12,261
|
Post by Brad Nelson on Jul 16, 2023 8:19:51 GMT -8
Herr Artler, that was a pleasure reading of your roundup summary of the great, and hot, land of Arkansas. If I had read that in The New Yorker, I would have thought, "Now, finally, an essay worth reading."
|
|
|
Post by kungfuzu on Jul 16, 2023 9:40:23 GMT -8
I see you have visited that part of the world. Vietnam has the advantage of having the Central Highlands. The highest point in Singapore is Bukit Timah. Not much relief from the heat. Penang, Malaysia has Penang Hill, which is almost 3,000 above sea level and that does make a difference. It is substantially cooler on top. Rich British Colonialists lived at various levels on the hill.
|
|
|
Post by artraveler on Jul 16, 2023 10:28:38 GMT -8
Here in Fayetteville, elevation 1200, summer is just summer. We live with it. I lived for a few years in Winslow. South of Fayetteville about 15 miles. Winslow is in the Boston Mountains at about 2500 feet. It is cooler, in part due to elevation 2-4 degrees and the forest surrounding the town. Winslow has the unique history of being the first town in Arkansas to have an all female mayor and town council, elected just after women got voting suffrage. Lumber used to be the industry in the Winslow area. A lot of the white oak cross ties for the railroads came from NWA from 1870-1930. By the 30s most of the white oak was cut and the timber industry moved south for Southern Pine. Winslow slowly declined in population and the great fire in the early 50s took the rest. It is now a rural town of about 300 with 15 churches each of which claimed to be the largest in Winslow. Baptists, anabaptist, Shakers and Quakers, Presbyterians and Episcopal, Roman Catholic and those who are only religious twice a year. All have made a home in Winslow. A small part of the real America.
|
|
Brad Nelson
Administrator
עַבְדְּךָ֔ אֶת־ הַתְּשׁוּעָ֥ה הַגְּדֹלָ֖ה הַזֹּ֑את
Posts: 12,261
|
Post by Brad Nelson on Jul 16, 2023 11:11:44 GMT -8
Here's the latest, perhaps final, version and it seems to work. It allows each player to discard up to five cards. Some of the string manipulation in order to do this is quite arcane. And, again, I'm sure there's some chess-club-brain programmer out there who could do it more elegantly. I've tried to organize it into recognizable modules. And I will play one hand and discard as I think you would and see who wins. There is $10.00 a piece bet on this. It might be cryptocurrency which means it might not be real money anyway. 10 REM "H2:CARDSDRW2.MSL" 20 RANDOMIZE 30 CLS 50 DIM CARDS$(52),PLAYER$(3,5),HAND$(3),DISCARD$(5) 60 !===================create the deck 80 FOR Y = 1 TO 52 90 READ CARDS$(Y) 150 NEXT Y 155 !==================deal 5 cards each to 3 players 155 FOR GAMER = 1 TO 3 160 FOR X = 1 TO 5 170 R=RND(52) 180 IF CARDS$(R)="" THEN END 185 IF MID$(CARDS$(R),3,1)="*" THEN GOTO 170 186 IF MID$(CARDS$(R),2,1)="H" THEN CARDS$(R)=MID$(CARDS$(R),1,1)+CHR$(0) 190 PLAYER$(GAMER,X)=CARDS$(R) 200 CARDS$(R)=CARDS$(R)+"*" 210 NEXT X 215 NEXT GAMER 220 GOSUB 575 222 !END 225 !===================ask for discards 250 PRINT:INPUT "PLAYER 1: DRAW OR STAND? ";ANS$ 255 IF ANS$="S" THEN 270 260 INPUT "ENTER DISCARDS: ";DISCARD$ 265 PERSON=1:GOSUB 492 270 PRINT:INPUT "PLAYER 2: DRAW OR STAND? ";ANS$ 275 IF ANS$="S" THEN 290 280 INPUT "ENTER DISCARDS: ";DISCARD$ 295 PERSON=2:GOSUB 492 290 PRINT:INPUT "PLAYER 3: DRAW OR STAND? ";ANS$ 300 IF ANS$="S" THEN 330 310 INPUT "ENTER DISCARDS: ";DISCARD$ 320 PERSON=3:GOSUB 492 330 GOSUB 575 345 END 340 !===================data for deck of cards 350 DATA AH,2H,3H,4H,5H,6H,7H,8H,9H,TH,JH,QH,KH 360 DATA A`,2`,3`,4`,5`,6`,7`,8`,9`,T`,J`,Q`,K` 370 DATA A#,2#,3#,4#,5#,6#,7#,8#,9#,T#,J#,Q#,K# 380 DATA A{,2{,3{,4{,5{,6{,7{,8{,9{,T{,J{,Q{,K{ 490 !===================choose new from discard 492 FOR LOADLOOP = 1 TO LEN(DISCARD$) 494 SLOT=(ASC(MID$(DISCARD$,LOADLOOP,1))-48) 500 R=RND(52) 510 IF CARDS$(R)="" THEN END 520 IF MID$(CARDS$(R),3,1)="*" THEN GOTO 500 530 IF MID$(CARDS$(R),2,1)="H" THEN CARDS$(R)=MID$(CARDS$(R),1,1)+CHR$(0) 540 PLAYER$(PERSON,SLOT)=CARDS$(R) 550 CARDS$(R)=CARDS$(R)+"*" 557 NEXT LOADLOOP 560 RETURN 570 !===================print hands 575 HAND$(1)="":HAND$(2)="":HAND$(3)="" 580 FOR PLAYER = 1 TO 3 582 FOR CARDS = 1 TO 5 584 HAND$(PLAYER)=HAND$(PLAYER)+PLAYER$(PLAYER,CARDS)+" " 586 NEXT CARDS 588 NEXT PLAYER 600 PRINT "BRAD ",HAND$(1) 610 PRINT "KFF ",HAND$(2) 620 PRINT "ARTLER ",HAND$(3) 630 RETURN
|
|