Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Day 003: SGN
#11
(11-08-2022, 05:47 PM)SMcNeill Wrote:
(11-08-2022, 04:11 PM)Pete Wrote: Nice. Without it, I'd probably just code:

Code: (Select All)
INPUT CarX.position, CarY.position
speedx = 1
IF CarX.position - CarY.position THEN CarX.position = CarX.position + (CarX.position - CarY.position) / ABS(CarX.position - CarY.position) * speedx
PRINT CarX.position
SLEEP
CLS
RUN

Aye, you can always code around notusing it.  Most commands are like that.  Don't like _PRINTSTRING?  Use LOCATE, PRINT, CSRLIN, and POS to duplicate its behavior.

One thing you have to admit though, comparing our two codes -- yours has a lot more to process going on under the hood.  In a game, where FPS matters, that might might a world of difference if inside some inner loop.

Agreed. I do like having keywords to handle things but I also like figuring out my own "functions" to make things I want happen. You have to admit the way I used that IF/THEN to avoid a division by zero error, in the code above, was PFC.

Pete

Pretty fine coding... Sure, let's go with that.
Reply


Messages In This Thread
Day 003: SGN - by SMcNeill - 11-08-2022, 12:34 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 01:39 PM
RE: Day 003: SGN - by SMcNeill - 11-08-2022, 02:29 PM
RE: Day 003: SGN - by Jack - 11-08-2022, 02:28 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 03:13 PM
RE: Day 003: SGN - by SMcNeill - 11-08-2022, 03:50 PM
RE: Day 003: SGN - by Jack - 11-08-2022, 03:43 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 04:11 PM
RE: Day 003: SGN - by SMcNeill - 11-08-2022, 05:47 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 05:57 PM
RE: Day 003: SGN - by mnrvovrfc - 11-08-2022, 04:51 PM
RE: Day 003: SGN - by bplus - 11-08-2022, 08:20 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 08:28 PM
RE: Day 003: SGN - by bplus - 11-08-2022, 09:37 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 09:43 PM
RE: Day 003: SGN - by bplus - 11-08-2022, 09:53 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 10:23 PM
RE: Day 003: SGN - by OldMoses - 11-09-2022, 07:18 AM
RE: Day 003: SGN - by Pete - 11-09-2022, 08:46 AM



Users browsing this thread: 2 Guest(s)