Write the longest sentence using keywords of a programming language
C++, 25 unique words, 28 total
True friend, do goto register for this new short public class for private auto operator (while inline, return this signed template), else break & void this long volatile union.
Mathematica 100 80 unique words
Here's a start. All standard words in Mathematica begin with upper case.
this includes I
, the square root of negative 1.
On Sunday, And For All Times-- Assuming, On Opening Clear Dynamic Interactive Notebooks For Setting Contours, I Do Not Translate Missing Blue Arrays Which Span Temporary, Asynchronous, And Invisible Characters, Nor Do I Remove Undefined Arrowheads With Editable And Sound Outer Orange Roots Which Magnify Shallow Names Together With False Attributes (Because Most Axes Split Full Inner Kernels In Reverse Order)-- And While I Animate Undefined Quiet Ticks, I Begin With Tolerance And Operate On All Manual Matrices, Interleaving Circle With Cylinder, Boxed Skeleton With Compiled Cuboid, Red Cross With Nearest Timing Pattern, And Join Repeated Unique White Links With Heads ...
In case anyone is interested, here are 500+ words recognized by Mathematica (no additional libraries required). They are not all keywords, but experienced Mathematica programers will know and have used just about all of them.
{Abort, Above, Abs, Accumulate, Accuracy, AddTo, After, Alignment, All, Alternatives, Analytic, And, Animate, Animator, Annotation, Annuity, Antialiasing, Antisymmetric, Apart, Appearance, Append, Apply, Array, Arrays, Arrow, Arrowheads, Assert, Assuming, Assumptions, Asynchronous, Attributes, Automatic, Axes, Axis, Back, Background, Backslash, Backward, Band, Baseline, Because, Beep, Before, Begin, Below, Binarize, Binomial, Blank, Blend, Block, Blur, Bookmarks, Booleans, Bottom, Bounds, Boxed, Break, Button, Byte, Cancel, Cap, Cases, Cashflow, Catch, Ceiling, Cell, Cells, Censoring, Center, Character, Characters, Check, Checkbox, Chop, Circle, Clear, Clip, Clock, Close, Closed, Closing, Coarse, Coefficient, Collect, Colon, Colorize, Column, Commonest, Compile, Compiled, Complement, Complex, Compose, Composition, Compress, Condition, Cone, Congruent, Conjunction, Connect, Constant, Constants, Context, Contexts, Continue, Contours, Control, Convergents, Convolve, Copyable, Correlation, Cot, Count, Covariance, Cross, Cumulant, Cup, Curl, Cycles, Cylinder, Darker, Date, Debug, Decrement, Default, Defer, [Degree], Deinitialization, Deletable, Delimiter, Delimiters, Denominator, Deploy, Deployed, Depth, Derivative, Diagonal, Dialog, Diamond, Differences, Dilation, Dimensions, Direction, Directive, Disjunction, Disk, Dispatch, Display, Distribute, Distributed, Dithering, Divide, Dividers, Divisible, Divisors, Do, Dot, Down, Drop, Dynamic, Editable, Eigenvalues, Element, Eliminate, Empty, Enabled, Encode, End, Enter, Epilog, Equal, Equivalent, Evaluator, Except, Exists, Exit, Expand, Expectation, Exponent, Export, Expression, Extract, Factor, Factorial, Fail, False, File, Filling, Find, First, Fit, Flat, Flatten, Floor, Fold, Font, For, Forward, Frame, Front, Full, Function, Gather, General, Generic, Get, Graph, Graphics, Greater, Grid, Hash, Head, Heads, Histogram, Hold, Hue, Hyperlink, Hyphenation, I, Identity, If, Image, Implies, In, Increment, Inherited, Inner, Input, Insert, Inset, Install, Integer, Integers, Integral, Integrate, Interactive, Interleaving, Interval, Invisible, Item, Join, Joined, Kernels, Label, Labeled, Large, Larger, Last, Latitude, Launch, Left, Legended, Length, Less, Level, Lighting, Limit, Line, Links, List, Listable, Listen, Literal, Locked, Log, Longest, Longitude, Magnification, Magnify, Majority, Manipulate, Manual, Map, Masking, Material, Matrices, Maximize, Mean, Median, Medium, Menu, Mesh, Message, Messages, Method, Minimize, Minors, Missing, Modal, Mode, Modular, Module, Modulus, Moment, Monday, Monitor, Most, Mouseover, Multinomial, Multiplicity, Multiselection, Names, Nearest, Needs, Negative, Nest, Next, None, Nor, Norm, Normal, Normalize, Not, Notebook, Notebooks, Null, Number, Numerator, Off, Offset, On, Opacity, Open, Opening, Operate, Optional, Options, Or, Order, Ordering, Orderless, Orthogonalize, Out, Outer, Over, Overflow, Paclet, Pane, Panel, Paneled, Parallelize, Parameter, Parenthesize, Part, Partition, Paste, Path, Pattern, Pause, Permutations, Permute, Perpendicular, [Pi], Piecewise, Pivoting, Placed, Placeholder, Plain, Play, Plot, Plus, Point, Polygon, Polynomials, Position, Positive, Power, Precedence, Precedes, Precision, Prefix, Prepend, Previous, Print, Probability, Projection, Prolog, Properties, Property, Proportion, Protect, Protected, Pruning, Put, Pyramid, Quantile, Quantity, Quartics, Quartiles, Queueing, Quiet, Quit, Quotient, Radon, Random, Range, Raster, Rasterize, Rational, Rationals, Read, Real, Reap, Record, Rectangle, Reduce, Refine, Refresh, Reinstall, Release, Remove, Removed, Repeated, Replace, Resampling, Rescale, Residue, Resolve, Rest, Return, Reverse, Riffle, Right, Root, Roots, Rotate, Round, Row, Rule, Saturday, Save, Saveable, Scale, Scaled, Scan, Scrollbars, Select, Selection, Sequence, Series, Set, Setbacks, Setter, Setting, Shading, Shallow, Share, Sharpen, Short, Show, Sidebar, Sign, Signature, Simplify, Skeleton, Skip, Slot, Smaller, Socket, Solve, Sound, Sow, Spacer, Spacings, Span, Speak, Sphere, Splice, Split, Square, Stack, Star, Streams, String, Stub, Subfactorial, Subgraph, Subscripted, Subset, Subtract, Sum, Superset, Surd, Syntax, Table, Take, Tally, Temporary, Text, Texture, Therefore, Thread, Threshold, Through, Ticks, Times, Timing, Together, Toggle, Toggler, Tolerance, Tooltip, Top, Total, Trace, Tracers, Translate, Transpose, True, Tube, Tuples, Undefined, Underlined, Underscript, Unequal, Uninstall, Union, Unique, Unitize, Unset, Up, Variables, Vertical, Wedge, Weights, Which, While, Whitespace, With, Word, Write}
While making sentences is not really my strong suite, here goes nothing -
Python 20 words
Finally, continue with import and raise global yield while class lambda is in break and try and print exec pass.
To help with checking, I wrote some code to check whether the words are in the keyword list or not.
from keyword import kwlist
from re import findall
def kwcheck(sentence):
"""Check whether all the words of a sentence are Python keywords"""
words= findall(r'\w+', sentence)
for word in words:
if word.lower() not in kwlist:
return False
return True, len(words)
if __name__ == '__main__':
sen= raw_input("Enter your sentence: ")
print kwcheck(sen)