Difference between revisions of "User:Inutt/CodingIdeas"

From Flexible Survival
Jump to: navigation, search
(Styling!)
(Add param check)
Line 8: Line 8:
  
 
* Add prop to players that have womb/other private rooms so they can be found without looping through all room objects
 
* Add prop to players that have womb/other private rooms so they can be found without looping through all room objects
 +
* Write a parameter checking function - basically an improved <code>checkargs</code>
 +
** Check number of supplied parameters is actually on the stack
 +
** Check type of arguments
 +
** Something like <code>"str:foo int:bar dbref:baz any:qux" checkparams</code>
 +
*** Check stack depth
 +
*** Split on ' ' and foreach in reverse order
 +
*** Split on ':' into type,name
 +
*** If top of stack matches type, add to dict of parameters by name

Revision as of 00:48, 20 August 2019

Coding ideas

Please note: These are just ideas that I've had and are not necessarily well thought out, are in no particular order, have no guarantee of ever actually happening, may be either impossible or inadvisable, and may contain nuts.

  • Add prop to players that have womb/other private rooms so they can be found without looping through all room objects
  • Write a parameter checking function - basically an improved checkargs
    • Check number of supplied parameters is actually on the stack
    • Check type of arguments
    • Something like "str:foo int:bar dbref:baz any:qux" checkparams
      • Check stack depth
      • Split on ' ' and foreach in reverse order
      • Split on ':' into type,name
      • If top of stack matches type, add to dict of parameters by name