Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fortune cookie script

21 views
Skip to first unread message

Mike Sanders

unread,
May 12, 2017, 9:58:15 AM5/12/17
to
beware wordwrap...


@echo off

:: fortune cookie batch/cmd script
:: Michael Sanders - 2017
::
:: this example is limited to 5 fortune cookies for brevity
:: for the complete script containing 3,580 fortunes visit:
:: https://busybox.hypermart.net/fortune-cookies.html
::
:: if you modify this script, also adjust the values of x & y
:: accordingly (best to use an editor with line numbering)
::
:: x = line number before first frotune
:: y = line number of last fortune

set x=21
set y=26

set /a r=%random% * (%y% - %x%) / 32768 + %x%
for /f "skip=%r% tokens=*" %%z in ('type %~fx0') do echo %%z & exit /b 0

If ignorance is bliss, why aren't there more happy people?
Be alert; the world needs more lerts.
I embrace poverty. To annoy me, send money.
In 1869 the waffle iron was invented for people who had wrinkled waffles.
IRS: Income Reduction Service.


--
later on,
Mike

https://busybox.hypermart.net
0 new messages