Learn to Code via Tutorials on Repl.it!

← Back to all posts
Let's learn Aardvark
h
hg0428 (192)

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.

Comments
hotnewtop
dotcomboom (139)

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.

hg0428 (192)

We have to pay to do that.
I cant pay for the Gold Membership.
@HahaYes

HahaYes (1862)

@hg0428 wdym pay to do that can you explain a bit more?

hg0428 (192)

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

HahaYes (1862)

@hg0428 BRO ITS IN A REPL DOMAIN JUST REMOVE IT

hg0428 (192)

I am working on that, it could take a [email protected]

CodeLongAndPros (1589)

Please don't advertise on repl.

CodeLongAndPros (1589)

@hg0428 There's ads in the website.

hg0428 (192)

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

HahaYes (1862)

@hg0428 yessir there are ads. Stop profiting off of others. There is a thing called your own domain :)

hg0428 (192)

We are not profiting. The place that hosts our docs put ads on there.
@HahaYes

k9chelsea2 (785)

is there no way to remove them?

HahaYes (1862)

@k9chelsea2 there are ways to remove them he just won't now he is ignoring us

hg0428 (192)

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

HahaYes (1862)

This man has a bigger ego than me smh

HahaYes (1862)

WAIT
WHY DO I SEE ADS

NONONONONO

hg0428 (192)

We did not put any ads on it.

@HahaYes

hg0428 (192)

We are not going to pay to remove ads. You can pay for it if you want.
@HahaYes

HahaYes (1862)

@hg0428 WHAT, ARE YOU SERIOUS THIS IS AGAINST RULES REMOVE THEM

hg0428 (192)

We can't, we have no ads to remove. @HahaYes

HahaYes (1862)

@hg0428 yeah... I'll go call Codelong over

hg0428 (192)

Ok. WE HAVE NO ADS. Its Readthedocs.io that has the ads
@HahaYes

PYer (3880)

You're putting ads on your repls?

hg0428 (192)

We are using https://readthedocs.io to host our documentation. They require a gold membership to remove [email protected]

HahaYes (1862)

@PYer wait what now you deny ads? What

PYer (3880)

Use repl.it to host... @hg0428

hg0428 (192)

I've been switching over, it could take a while.
@PYer

HahaYes (1862)

@hg0428 bro you are hosting on repl. Can't you see a repl.co?

hg0428 (192)

I know, but our documentation is on readthecods.io
We have an iframe in the [email protected]

PYer (3880)

Ah... Interesting... @hg0428

PYer (3880)

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

MasterGameMaker (10)

Wow, you have a tutorial too?
This is amazing!

theamazingplant (3)

Thank you for the tutorial!

HahaYes (1862)

nice project... I was confused by the ads...

JacksonPhilips (66)

Nice. Clean up the website, though, it's bright on the eyes. :/

AmazingMech2418 (1039)


Do you make money from the advertising? This says that you can try it for free with $60 credit...

hg0428 (192)

No. We have to pay to remove [email protected]

Codemonkey51 (1048)

I think that's to buy an ad.... @AmazingMech2418

hg0428 (192)

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.

hg0428 (192)

Also, try making a project yourself on readtheroics.io, you have to have the gold membership to remove ads from your project. @Codemonkey51

Codemonkey51 (1048)

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

k9chelsea2 (785)

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

HahaYes (1862)

its a repl.co domain. Its "owned" by repl

CodingCactus (4195)

pythonCode.replace('print', 'output').replace('import', '#include')
That's what I'm seeing

CodingCactus (4195)

@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???

hg0428 (192)

What ad? What do you mean the text is not at the center?
@CodingCactus

CodingCactus (4195)

@hg0428 don't bully the handwriting

hg0428 (192)

We did not add the ads, that is an iframe. @CodingCactus

hg0428 (192)

In an iframe.
It will be fixed as soon as we can.
@CodingCactus

CodingCactus (4195)

@hg0428 I don't care what html tag it is, it is still advertising something

hg0428 (192)

It will be fixed as soon as possible. @CodingCactus

hg0428 (192)

Plus, the add was already there before we even made the website, we did not put any ads on [email protected]

CodingCactus (4195)

@hg0428 how do you make a website and not realise you have put ads on it?

hg0428 (192)

It is just readthedocs.io in a frame.
readthedocs.io puts ads on their [email protected]

CodingCactus (4195)

@hg0428 make your own website lmao

hg0428 (192)

Just not yet.
I told you we will fix it soon.
@CodingCactus

PlasDev (6)

@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.

HahaYes (1862)

@PlasDev mate cactus is a mod. He's gonna ban you

HahaYes (1862)

@PlasDev bro ads are not allowed on a repl domain.

hg0428 (192)

We did not put any ads on it.
@HahaYes

hg0428 (192)

We did not put any ads on it.
@HahaYes

hg0428 (192)

If you want, you can pay to remove ads.
@CodingCactus

hg0428 (192)

Are you going to report us for using readthedocs.io?
@CodingCactus

PlasDev (6)

@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

hg0428 (192)

We can get banned for using readthedocs.io?
@HahaYes

CodingCactus (4195)

@hg0428 bruh I'm not paying anything, just make your own website, its easy

HahaYes (1862)

@hg0428 you're not gonna get us to pay. Move your ads somewhere else.

CodingCactus (4195)

@HahaYes hey just calm it down it a bit, there was clearly just a misunderstanding.

hg0428 (192)

Yes, you did misunderstand. Thank you for admitting.
@CodingCactus

HahaYes (1862)

@hg0428 oh boy this man has a big ego.

hg0428 (192)

They are from readthedocs.io
That is the website that hosts our docs
@HahaYes

HahaYes (1862)

@hg0428 uh quick question... are you 13?

PlasDev (6)

@HahaYes (i am older than that)

HahaYes (1862)

@PlasDev well by the egos I assume 11

CodingCactus (4195)

@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?

hg0428 (192)

We are working on it, it could take a [email protected]

PlasDev (6)

@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.

CodingCactus (4195)

@PlasDev hi your data type section is empty

PlasDev (6)

@CodingCactus :O, lol sorry will work on that. Glad you're reading the docs!

CodingCactus (4195)

@PlasDev i'm transferring them to a website without ads for you.

PlasDev (6)

@CodingCactus Thanks! Sorry, ive just been at school all day :p

CodingCactus (4195)

@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)

HahaYes (1862)

@PlasDev Bois I'm the biggest hypocrite you'll ever find

hg0428 (192)

Are we still able to easily add to it with markdown?
It doesn't matter, I am just [email protected]

CodeLongAndPros (1589)

@hg0428 Uh can't you use Sphinx to make HTML docs?