文档介绍:Best of Ruby Quiz
Volume One
James Edward Gray II
The Pragmatic Bookshelf
Raleigh, North Carolina Dallas, Texas
P r a g m a t i c
B o o k s h e l f
Many of the designations used by manufacturers and sellers to distinguish their products
are claimed as trademarks. Where those designations appear in this book, and The
Pragmatic Programmers, LLC was aware of a trademark claim, the designations have
been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The
Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g
device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher
assumes no responsibility for errors or omissions, or for damages that may result from
the use of information (including program listings) contained herein.
Our Pragmatic courses, workshops, and other products can help you and your team
create better software and have more fun. For more information, as well as the latest
Pragmatic titles, please visit us at
Copyright © 2006 The Pragmatic Programmers LLC.
All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmit-
ted, in any form, or by any means, electronic, mechanical, photocopying, recording, or
otherwise, without the prior consent of the publisher.
Printed in the United States of America.
ISBN 0-9766940-7-7
Printed on acid-free paper with 85% recycled, 30% post-consumer content.
First printing, February 2006
Version: 2006-3-14
Contents
1 Introduction 1
I The Quizzes 5
1. Mad Libs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2. LCD Numbers . . . . . . . . . . . . . . . . . . . . . . . . . 8
3. Parser . . . . . . . . . . . . . . . . . . . . . . . 9
4. Animal Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5. Scrabble Stems . . . . . . . . . . . . . . . . . . . . . . . . 13
6. (