On his last chance, Ralph Sampson finally got it right.

He had missed four foul shots with the game on the line, including two with seven seconds left. In his farewell appearance in University Hall, an event that the University of Virginia insisted on turning into a circus, Sampson was in imminent danger of giving Maryland Coach Lefty Driesell his wish.

"I want him to go out of there with his tail between his legs," Driesell had said Saturday.

Sampson might have done just that, might have become the first player in history to be humiliated and have his number retired on the same day had not Craig Robinson tipped the ball back to him after the last of his four bricks.

Sampson threw up a soft eight-foot shot that found the net with three seconds to play. That changed the score from 81-80, Maryland, to 82-81, Virginia, and when the Cavaliers held on to win 83-81, all was well in the House That Ralph Built.

Virginia had been planning this day for a long time. All the personnel working in University Hall wore tuxedos, rented at a cost of about $15 each from Dave Cooke, a Cavalier captain 30 years ago, who is now in the business of renting tuxedos. The school got 90 of them, at cost.

Naturally, the school decided to make some money off the event, selling souvenir buttons--"I was at Ralph's last game"--and posters and, who knows, maybe tours of Ralph's room on The Lawn.

When Sampson chugged onto the floor to warm up, they went wild, one woman waving a sign which said, "Marry Me Ralph," while another announced, "Ralph, You're a God."

Maybe. But against Maryland, Sampson has been extremely mortal the last four years. Buck Williams outplayed him three times out of five during his first two years and, last year, Sampson missed crucial free throws in College Park to let Maryland escape with an overtime victory, one that cost Virginia the top-seeding in the ACC tournament.

Today, Driesell, relishing his role as the villain, was a perfect Snidely Whiplash. He dressed his team in black, even threatened to appear on the bench in an old sweatshirt as a contrast to the tuxedos. What's more, even with Herman Veal suspended and everyone but son Chuck in deep foul trouble, Driesell almost stole the game.

In the end, the script worked out fine. In the euphoria of the victory, Sampson's very human foul shooting (six of 12), the bad shot he took from the base line with Virginia leading, 80-79, and some of the ugly words he exchanged with Maryland players during the game, were forgotten.

With the game won, Sampson and his fellow seniors, Robinson and Doug Newburg, came back for their curtain calls and for the endless spiel about their achievements. The only thing that saved the scene was the sight of Virginia Gov. Charles Robb, standing a few feet from Sampson, who ignored him completely, doing an Ed McMahon routine, yelling, "Heyo!" each time P.A. announcer Charlie Smith cited another milestone: "And, then at age 12, Ralph . . . "

The saving grace to the afternoon, though, was Sampson. When Smith called him, "The athlete who has received more personal recognition than any athlete in college basketball history" (Lew Alcindor must have been playing some other game), Sampson nudged his buddy Newburg and said, "Way to go Doug, raise your hand." Newburg did.

When someone came out to present a $100,000 check to University President Frank Hereford for a scholarship that is going to be endowed in Sampson's name, Ralph asked, "Do I get a cut?"

He could laugh at that, since next year at this time that kind of money will be his per diem. And, at last, Sampson made a speech, after a debate about whether he should. "You want me to, I will," Sampson said.

So, he did. He apologized for missing the foul shots, he graciously credited Robinson and Newburg. "It's been a great four years, they've been quick," he said. "I wish I could stay another, but I've got to move on." He looked at Robinson and Newburg and his eyes glistened just a little. "They've been my friends," he said, "And we'll be friends forever."

Finally: "Look what four years here have done for me, being a speech major, you can see what it's done. I didn't prepare a speech, but I talked anyway."

With that, he exited, having said more than 108 victories can, more even than that still elusive national championship would say.