Hack Forums
[Shell] Graphing Calculator (My Version) - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] Graphing Calculator (My Version) (/showthread.php?tid=3979198)

Pages: Pages 1 2


Graphing Calculator (My Version) - WOLGA - Jan 6, 2014

Credits to Icarus for idea.

Here's one example of it in action:

Example (Click to View)

And here's the source:

Code
@echo off & setlocal enabledelayedexpansion
mode con cols=51 lines=35
color 0f
title %~n0
set "input="
for /L %%A in (-10,1,10) do (
for /L %%B in (-10,1,10) do (
set "%%A.%%B=ÅÄ"
))
:disp
cls
for /L %%A in (-10,1,10) do (
set line%%A=
)
set 0.0=ÎÄ
for /L %%A in (-10,1,10) do (
for /L %%B in (-10,1,10) do (
set line%%A=!line%%A!!%%A.%%B!
))
echo.Displaying Equation: Y = %input%
echo.ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
for /L %%A in (10,-1,-10) do (
echo.³ !line%%A! ³ %%A
)
echo.ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
echo.  - -
echo.  1 0 0 1
echo.  0 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 0
echo.The x-axis coordinates are read top to bottom.
echo.
echo.
echo.
set/p input="[Equation] Y = "
call:equation
goto disp
:equation
for /L %%A in (-10,1,10) do (
for /L %%B in (-10,1,10) do (
set "%%A.%%B=ÅÄ"
))
for /L %%A in (-10,1,10) do (
set /a y=!input:x=%%A!
set /a y=!input:X=%%A!
echo !y!
set !y!.%%A=±Ä
)
exit/b

Or... if the formatting is screwing up, use the DL instead, here:

http://www.mediafire.com/download/8tn8iveo91vkhn9/Project.bat

Enjoy! 🤝


* - Options - Jan 6, 2014

But it.. it hurts my eyes! My eyes are burning >:c

I'm not sure where you would actually need this for, but It is indeed a nice creation.


* - WOLGA - Jan 6, 2014

(Jan 6, 2014 11:51 AM)Options Wrote:  But it.. it hurts my eyes! My eyes are burning >:c

I'm not sure where you would actually need this for, but It is indeed a nice creation.

Well, it's a calculator. A graphing one. And I can't tell if
Quote:But it.. it hurts my eyes! My eyes are burning >:c
is supposed to be an insult or not.


* - iHockey - Jan 6, 2014

Don't listen to that guy, he's just trying to be a jackass...


* - Diamond Heart - Jan 30, 2014

great job man, it is really nice!!!!


* - Ebony - Jan 30, 2014

Wow that's seriously amazing. Great work


* - MrCortex - Jan 30, 2014

Woow this looks funny.
But i don't know who will use this, because i need a stronger glasses after using it 😖

Well done OP for this funny peace of code.🤝


* - vaan - Jan 30, 2014

Great job, if you can code like tha. Awesome


* - Creatorofall - Feb 2, 2014

Good work man, can't wait till I learn a bit more.


* - WOLGA - Feb 5, 2014

Thanks guys! This is just an example of what batch can do. Check out other members work too!


* - Ebony - Feb 5, 2014

Its very good. I could not create this. But maybe as a challenge, make it be able to go above 10. Or accepts something such as 1/2x +5. But again nice:)


* - 6577657534735 - Feb 6, 2014

Wow this is awesome

It's so simply written, if I tried to make this it would definitely take me way more lines

Very HQ


* - annikk.exe - Feb 6, 2014

Great idea and brilliant execution. Your code is elegant, friend. :> Another HQ batch thread, w00t!


* - WOLGA - Feb 6, 2014

(Feb 6, 2014 01:50 AM)annikk.exe Wrote:  Great idea and brilliant execution. Your code is elegant, friend. :> Another HQ batch thread, w00t!

Haha, definetly thank Icarus for the idea. As for everything else, thanks! 🤗


* - ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ - Feb 6, 2014

(Feb 6, 2014 07:05 PM)Qwertyuiopasdfghjklzxc Wrote:  Haha, definetly thank Icarus for the idea. As for everything else, thanks! 🤗

Thank you for credit on the idea. Everyone else failed to recognize that.