gyaanscript
v1.0.3
Published
Dynamic Hindi scripting with wisdom and sims
Maintainers
Readme
GyaanScript
Unlock the Wisdom of Code in Hindi
GyaanScript is a dynamic, Hindi-based scripting language designed with simplicity and elegance. Write code that feels like poetry, blending logic with the charm of Hindi syntax. Whether you're crunching numbers, managing lists, or looping with purpose, GyaanScript brings a fresh vibe to programming.
✨ Features
- Variables: Declare with
soch—think it, and it’s real. - Math: Add (
badha), subtract (ghata), multiply (guna), divide (bhag)—easy as breathing. - Lists: Manage collections with
sankhyaandjod. - Sets: Unique values via
samuh—no duplicates, pure clarity. - Conditionals: Decide with
agarandnahi to—wisdom in choices. - Loops: Repeat with
jab tak—power in persistence.
🚀 Installation
Get started in seconds with npm:
npm install gyaanscript🛠️ Usage
Import GyaanScript, create an instance, and run your Hindi code.
Basic Example
const GyanScript = require('gyaanscript').default;
const gs = new GyanScript();
const code = `
soch x hai 5
bata x
`;
console.log(gs.run(code)); // Outputs: 5Full Power Demo
const GyanScript = require('gyaanscript').default;
const gs = new GyanScript();
const code = `
soch x hai 0
jab tak x chhota hai 3
badha x se 1
bata x
khatam gyan
`;
console.log(gs.run(code)); // Outputs:
// 1
// 2📘 Documentation
Variables
- Syntax:
soch <var> hai <value> - Example:
soch num hai 42 bata num // 42
Math Operations
- Addition:
badha <var> se <value> - Subtraction:
ghata <var> se <value> - Multiplication:
guna <var> se <value> - Division:
bhag <var> se <value> - Example:
soch x hai 5 badha x se 3 // x = 8 ghata x se 2 // x = 6 guna x se 2 // x = 12 bhag x se 3 // x = 4 bata x // 4
Lists
- Declare:
sankhya <name> hai [<values>] - Add:
jod <list> mein <value> - Get Item:
bata sankhya <list> ka <index> - Example:
sankhya nums hai [1, 2, 3] jod nums mein 4 bata sankhya nums ka 0 // 1 bata sankhya nums ka 3 // 4
Sets
- Declare:
samuh <name> hai {<values>} - Add Item:
jod <set> mein <value> - Check Item:
hai <value> samuh <name> mein - Example:
samuh unique hai {1, 2, 2} jod unique mein 3 hai 2 samuh unique mein // hai hai 5 samuh unique mein // nahi
Conditionals
- Syntax:
agar <var> bada hai <value> ... nahi to ... - Example:
soch x hai 10 agar x bada hai 7 bata "Yes" nahi to bata "No" // Yes
Loops
- Syntax:
jab tak <var> chhota hai <value> ... khatam gyan - Example:
soch x hai 0 jab tak x chhota hai 3 badha x se 1 bata x khatam gyan // 1 // 2
Output
- Variable:
bata <var> - String:
bata "<text>" - Example:
soch x hai 7 bata x // 7 bata "Hello" // Hello
🌟 Examples
Counting Up
soch count hai 1
jab tak count chhota hai 5
bata count
badha count se 1
khatam gyan
// 1
// 2
// 3
// 4List Manipulation
sankhya fruits hai ["seb", "kela"]
jod fruits mein "am"
bata sankhya fruits ka 0 // seb
bata sankhya fruits ka 2 // amSet Check
samuh numbers hai {1, 2, 3}
jod numbers mein 2
hai 2 samuh numbers mein // hai
hai 4 samuh numbers mein // nahiMath Fun
soch x hai 10
badha x se 5 // x = 15
guna x se 2 // x = 30
bhag x se 3 // x = 10
bata x // 10📜 License
All Rights Reserved © 2025 Ayush Panigrahi
Unauthorized copying, distribution, or modification of this software is prohibited. Use it, love it, but don’t steal it!
🤝 Contributing
Got ideas? Want to add more Hindi flair? Reach out to me directly—this is a passion project, not an open-source free-for-all (yet!).
🎉 Get Started
Install it, play with it, and let the wisdom of GyaanScript flow through your code. Questions? Hit me up!
