Welcome to Aardvark, the language that has entranced programmers by its simplicity and amazingness for the last few days.
My goal is to by the end of this lesson have taught you the basics of the Aardvark language and get you on a course to become an amazing Aardvark developer.
In programming, you usually start with a Hello World program, but let's mix it up this time, lets start by learning how to write a program that takes the user's username as input and outputs a random welcome message. But first, we need to learn basic input and output.
This code will output This is my Aardvark program!
:
output("This is my Aardvark program!")
You see, not that hard, now don't forget the quotes, it won't work right without them. Let's look at what this code does, output
has parentheses, which means its a function, and then inside the quotes are the message that shows up on the screen. Hmm, I wonder if I can change what's in the quotes and it will change the message, lets try it:
output("This is a different message")
If you run that program you will see that it worked! Now let's learn how to take user input:
input("Enter your username: ")
If you run that code, you will see that it will give that message and then let you type in an answer. But how do we store that answer in our program? We use variables, variables store data for use later in the code. So if we add a =
to the beginning of that then it will store the input in the variable a
, lets try it:
a = input("Enter your username: ")
How do we know if it worked? Well, let's try to output the data inside a
. Try this code:
a = input("Enter your username: ")
output(a)
When you output variables, you don't need those quotes. Let's run it. When we run it, it will ask for our username and then output what we typed in. We can already get their username, we still need the random welcome message, lets first start with just a welcome message. If we output "Welcome, " before we output what they typed in, it would say Welcome,
plus their username. Let's try it:
a = input("Enter your username: ")
output("Welcome, ")
output(a)
It worked! Let's simplify it, just do "Welcome, " + a
instead of doing it on separate lines. Try this:
a = input("Enter your username: ")
output("Welcome, " + a)
It worked! We now have our username input and our welcome message, but what about the random. How can we make it do something random?
In Aardvark, the tools module has some functions to help us do random stuff. But how do we include a module? Try this code:
#include tools
It makes all the functions in the tools module available in our program, lets add it to our code:
#include tools
a = input("Enter your username: ")
output("Welcome, " + a)
Now, what is the function to do random stuff? In Aardvark, you can use the randomchoice
function from the tools module to make random choices. randomchoice
takes a list of possible choices as its one argument. How do we make a list in Aardvark? Just put it in between [
and ]
and separate the items by commas. Let's try this code:
#include tools
username = input("Enter your username: ")
message = randomchoice("Welcome, ", "Hello, ", "Have a good day, ")
output(message + username)
It worked! We have reached our goal!
If you would like to continue learning Aardvark, watch for future tutorials, or go to our website.
Please don't advertise on repl.
We don't
@CodeLongAndPros
@hg0428 There's ads in the website.
Those are from readthedocs.io
Are we not allowed to use that site.
Its an iframe for readthedocs.io
Thats where our docs are hosted.
@CodeLongAndPros
@hg0428 yessir there are ads. Stop profiting off of others. There is a thing called your own domain :)
We are not profiting. The place that hosts our docs put ads on there.
@HahaYes
is there no way to remove them?
@k9chelsea2 there are ways to remove them he just won't now he is ignoring us
I am, I am working on it.
To remove them I have to pay for gold membership.
So I have to remake it in a repl.
@HahaYes
You're putting ads on your repls?
@PYer IKR HERESY
excuse me? @hg0428
We are using https://readthedocs.io to host our documentation. They require a gold membership to remove [email protected]
@PYer wait what now you deny ads? What
Use repl.it to host... @hg0428
I've been switching over, it could take a while.
@PYer
@hg0428 bro you are hosting on repl. Can't you see a repl.co?
It looks like it is already on repl.it? https://aardvark-website.programit.repl.co/docs/latest/index.html @hg0428
I know, but our documentation is on readthecods.io
We have an iframe in the [email protected]
Ah... Interesting... @hg0428
@hg0428 just delete it
No. It's beyond his abilities rn. After he hosts it on repl.it (and I mean with the majority of code, not with the iframe to readthedocs that he currently has), he'll be able to remove ads. He is not making a profit off of the advertisements, and moderators have deemed it appropriate. @HahaYes
STOP THE ADS
We have to pay to do that.
I cant pay for the Gold Membership.
@HahaYes
@hg0428 wdym pay to do that can you explain a bit more?
Yes, the company that hosts our documentation, https://readthedocs.io, has put ads on there and will not let us remove them without a gold membership.
@HahaYes
@hg0428 BRO ITS IN A REPL DOMAIN JUST REMOVE IT
I am working on that, it could take a [email protected]
@hg0428 just delete the code
This man has a bigger ego than me smh
WAIT
WHY DO I SEE ADS
NONONONONO
We did not put any ads on it.
We are not going to pay to remove ads. You can pay for it if you want.
@HahaYes
@hg0428 WHAT, ARE YOU SERIOUS THIS IS AGAINST RULES REMOVE THEM
We can't, we have no ads to remove. @HahaYes
@hg0428 yeah... I'll go call Codelong over
Ok. WE HAVE NO ADS. Its Readthedocs.io that has the ads
@HahaYes
@hg0428 yes you do
@Waku is this wuru
Wow, you have a tutorial too?
This is amazing!
Thank you for the tutorial!
nice project... I was confused by the ads...
Nice. Clean up the website, though, it's bright on the eyes. :/
No. We have to pay to remove [email protected]
I think that's to buy an ad.... @AmazingMech2418
No, it says it on [email protected] , I do not want to have this conversation all over again. Read all the other comments to get and answer for your question, I recommend that you read ALL of them.
Also, try making a project yourself on readtheroics.io, you have to have the gold membership to remove ads from your project. @Codemonkey51
I have ik that you have to get gold to remove ads I'm just saying I think the $60 credit is to BUY ads @hg0428
maybe you can hot the docs on a different site there are also free domains you can use without having ads i dont think they are allowed on replit
I am switching [email protected]
oh ok nice
its a repl.co domain. Its "owned" by repl
pythonCode.replace('print', 'output').replace('import', '#include')
That's what I'm seeing
Not close. There is a big difference, look at our docs: https://aardvark-website.programit.repl.co/docs/latest/index.html
@hg0428 sorry but you aren't allowed to have ads on repl.it hosted sites. Also what is that margin!!?? SO MUCH WHITESPACE! Also the text isn't in the center of the screen lmao. And two scroll bars???
What ad? What do you mean the text is not at the center?
@CodingCactus
@hg0428 don't bully the handwriting
We did not add the ads, that is an iframe. @CodingCactus
@hg0428 its an ad
In an iframe.
It will be fixed as soon as we can.
@CodingCactus
@hg0428 I don't care what html tag it is, it is still advertising something
It will be fixed as soon as possible. @CodingCactus
Plus, the add was already there before we even made the website, we did not put any ads on [email protected]
@hg0428 how do you make a website and not realise you have put ads on it?
It is just readthedocs.io in a frame.
readthedocs.io puts ads on their [email protected]
@hg0428 make your own website lmao
Just not yet.
I told you we will fix it soon.
@CodingCactus
@CodingCactus if you have money for a domain, and hosting we will be happy to take it :) otherwise get off our back about getting a website lol.
@PlasDev mate cactus is a mod. He's gonna ban you
@PlasDev bro ads are not allowed on a repl domain.
We did not put any ads on it.
@HahaYes
We did not put any ads on it.
@HahaYes
If you want, you can pay to remove ads.
@CodingCactus
Are you going to report us for using readthedocs.io?
@CodingCactus
@HahaYes @CodingCactus In all honesty idk what the practice is, I just heard about langjam, and started using it. We aren't doing it on purpose, it just happens that we use RTD so we get ads
We can get banned for using readthedocs.io?
@HahaYes
@hg0428 bruh I'm not paying anything, just make your own website, its easy
@hg0428 you're not gonna get us to pay. Move your ads somewhere else.
@HahaYes hey just calm it down it a bit, there was clearly just a misunderstanding.
We have no adds.
@HahaYes
Yes, you did misunderstand. Thank you for admitting.
@CodingCactus
@hg0428 well there are still ads
@hg0428 there are still ads
@hg0428 oh boy this man has a big ego.
They are from readthedocs.io
That is the website that hosts our docs
@HahaYes
@hg0428 uh quick question... are you 13?
@HahaYes (i am older than that)
@PlasDev well by the egos I assume 11
@hg0428 ok, so the website you are using to host the docs put the ads on there. So, maybe, why don't you make your own website?
We are working on it, it could take a [email protected]
@hg0428 ok nice!
@HahaYes What ego? Just chill out man. Stop bickering like (ironically) 4 year olds. Starting drama is just painful for everyone. You're just being a hypocrite.
@PlasDev hi your data type section is empty
We will fix [email protected]
@CodingCactus :O, lol sorry will work on that. Glad you're reading the docs!
@PlasDev i'm transferring them to a website without ads for you.
@CodingCactus Thanks! Sorry, ive just been at school all day :p
@PlasDev hi, here you go https://aardvark-docs.codingcactus.repl.co/
Obviously change the css and stuff if you want. I might try to add a sidebar to navigate tomorrow if you want.
(repl to fork: https://repl.it/@CodingCactus/Aardvark-docs)
@PlasDev Bois I'm the biggest hypocrite you'll ever find
Are we still able to easily add to it with markdown?
It doesn't matter, I am just [email protected]
@hg0428 erm no, do html
@hg0428 Uh can't you use Sphinx to make HTML docs?
People here not knowing what Read the Docs and iframes are... :(
I'm not a Talk mod (just a fellow from the Discord) so I can't say for sure but I believe that hosting the docs there is fine, and it's very clear that you aren't making money off of it and I really don't get all the antagonizing.
So people don't get confused may I suggest instead of using an iframe, link to your Read the Docs site in a new tab? Of course, having the documentation on the repl.co site itself is fine too and means you wouldn't have to deal with ads. (That said, I have used RTD myself for my documentation in the past and it's very handy!)
You have a very fine project and I wish you best of luck in the competition.