Neopets Name Generator

Neopets Adventure Generator is a game where it will list a complete set of Neoadventures for you to progress in, and it will also give you the ability to browse these adventures by some of the easiest ways, meaning by categories, or by usernames. There will be a top 40 reserved for the top 40Read more Neopets Adventure Generator ›. Pet name generator. Discussion in 'Neopets Program Discussion' started by SayaChibi, Sep 25, 2010. SayaChibi Level I. Joined: Sep 23, 2010 Messages: 55 Likes. Neopets.Com - Virtual Pet Community! Join up for free games, shops, auctions, chat and more! These days I tried to find a name for my new BD pet on this generator and I am so glad I did it: I got Elareen, a name that I felt in love for and wasnt taken yet!:3 So, I will post the link here, you may know this already, but I think it could be very useful, and this kind of stuff is never too much at all!

Contents

Generator
Section
Background
Objectives
Overview
File Structure
Instructions
Resources

Background

Before we cover the topic of web frameworks, like Sinatra and Rails, we introduce the idea of ERB, or 'Embedded Ruby.' ERB is an easy way to get Ruby to use templates, usually written in HTML, to create web pages. This lab is a pre-ERB lab in that it uses Ruby to generate HTML files without the benefit of ERB.

Cleo mod for android. Auto-tune 9. Hopefully upon the completion of this lab, you will:

  • feel comfortable getting objects to interact with each other
  • understand why ERB is so useful

Objectives

You're going to be making a rudimentary version of Neopets using object oriented Ruby. In the final section of this lab, you will be creating an HTML file using Ruby.

Neopets Name Checker

Overview

Models

On neopets.com, there are users, items, and neopets:

Neopets Name Generator 5e

  • Items are of the simplest class and just have a type.
  • Users have have a name, neopoints (the Neopia version of currency), neopets, and items.
  • Like users, neopets also can have items. In addition, they have a name, a species, strength, defence, movement, and a mood.

Methods

Generator

Some basic things that users can do on neopets.com are buy pets, buy items, sell pets, feed pets, and give items to pets (kinda like giving them presents).

They can also read to their pets, submit items for auction, etc. Tilt pinball. but we'll just be focusing on the five methods above.

HTML Generator

Once all these methods are built out, you'll make a method in the user class that will generate an HTML file to display the user's 'account' (an HTML dashboard, so to speak). For instance, that HTML file could look like this:

To see the basic HTML structure that went into creating the above 'profile', take a look at example.html in the views/readme_example folder.

File Structure

This lab has the following structure:

It will be helpful to be familiar with this structure as your Neopet class will select a random species for a new neopet using the file names in the folder public/img/neopets/.

Along the same lines, your Item class will select a random type from the file names in the public/img/items folder.

Furthermore, your User class will have a method, make_index_page, that will generate an HTML file and save it to the views/users/ folder.

Instructions

This is a test-driven lab and tests are written in order of increasing difficulty. Therefore, we suggest that you tackle them in order.

If you get stuck, be sure to refer to the curated resources below. If still stuck, feel free to:

  • google to your heart's content
  • ask a classmate
  • ask an instructor

Resources

  • Stack Overflow - Get names of all files from a folder with Ruby
  • Stack Overflow - Writing to a file in Ruby
  • Ruby Monk- Using the File Class
  • DaniWeb - Ruby - Create Html Files Using Ruby
  • stuartellis.eu - An Introduction to ERB Templating
  • Rasmus Roon Nielsen's Blog - Ruby's ERB Templating System