Jump to content

User:J.smith/pseudocode

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Vicarious (talk | contribs) at 05:22, 29 December 2006 (modifying Checkpage, more to come). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
DiffList[?, 3]  				// List of [oldID][Date][User] for page in question
PagesLeft = Length of DiffList[]-1		// Total pages left in question
PageToSearch					// Pointer to where we are at in the list
LastPageChecked 				// Last page check was performed on
LastResults = TRUE				// TRUE/FALSE return for if LastPageChecked had string
SearchString					// String of text we are searching for
CheckPage(page, string)				// Checks page for string and return boolean true if found (uses Qurey.php to grab wikimarkup and does a search/find for the string (to be writen))


While (PagesLeft > 2) 				// If PagesLeft is more then 2 then keep searching.


	If (LastResults = TRUE)			//If "checkpage" resulted in a "positive"
		PagesLeft = (PagesLeft/2)
		PageToSearch = PageToSearch - PageLeft
		LastPageChecked = DiffList[PageToSearch, 0]

	Else (LastResults = FALSE)		//If "checkpage" resulted in a "negitive"
		PagesLeft = (PagesLeft/2)
		PageToSearch = PageToSearch + PagesLeft
		LastPageChecked = DiffList[PageToSearch, 0]

	If (CheckPage(LastPageChecked, SearchString) = TRUE)
		LastResults = TRUE

	Else
		LastResults = FALSE

Return (LastPageChecked)